心理

当前位置 /首页/完美生活/心理/列表

python中upper函数含义

python中upper函数含义

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

语法

upper()方法语法:

r()

参数

NA。

返回值

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

实例

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

#!/usr/bin/python

str = "this is string !!!"

print &#r() : ", r()

以上实例输出结果如下:

r() : THIS IS STRING !!!

实例扩展:

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)()

print ("go B go!")

class C(A):

def go(self):

super(C, self)()

print ("go C go!")

def stop(self):

super(C, self)()

print ("stop C stop!")

class D(B,C):

def go(self):

super(D, self)()

print ("go D go!")

def stop(self):

super(D, self)()

print ("stop D stop!")

def pause(self):

print ("wait D

TAG标签:python upper 函数 #