首页后端开发Pythonpython中upper函数含义

python中upper函数含义

时间2023-06-04 08:17:02发布访客分类Python浏览1053
导读:python中upper函数含义?Python upper( 方法将字符串中的小写字母转为大写字母。语法upper( 方法语法:str.upper( 参数NA。返回值返回小写字母转为大写字母的字符串。实例以下实例展示了 upper( 函数...

python中upper函数含义?

Python upper() 方法将字符串中的小写字母转为大写字母。

语法

upper()方法语法:

str.upper()

参数

NA。

返回值

返回小写字母转为大写字母的字符串。

实例

以下实例展示了 upper()函数的使用方法:

#!/usr/bin/python

str = "this is string example....wow!!!"

print "str.upper() : ", str.upper()

以上实例输出结果如下:

str.upper() : THIS IS STRING EXAMPLE....WOW!!!

实例扩展:

class A():

def go(self):

print ("go A go!")

def stop(self):

print ("stop A stop!")

def pause(self):

raise Exception("Not Implemented")

class B(A):

def go(self):

super(B, self).go()

print ("go B go!")

class C(A):

def go(self):

super(C, self).go()

print ("go C go!")

def stop(self):

super(C, self).stop()

print ("stop C stop!")

class D(B,C):

def go(self):

super(D, self).go()

print ("go D go!")

def stop(self):

super(D, self).stop()

print ("stop D stop!")

def pause(self):

print ("wait D

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: python中upper函数含义
本文地址: https://pptw.com/jishu/60832.html
python怎么输出数据表格列标签 Python需要用户输入一个数字

游客 回复需填写必要信息