英国留学生政策python中upper是做什么⽤的Python upper()⽅法
Python 字符串
描述
Python upper() ⽅法将字符串中的⼩写字母转为⼤写字母。
语法
upper()⽅法语法:
str.upper()
参数
NA。
返回值
返回⼩写字母转为⼤写字母的字符串。
实例
以下实例展⽰了 upper()函数的使⽤⽅法:
气球的英文单词#!/usr/bin/python
str = "this is wow"
print "str.upper() : ", str.upper()
以上实例输出结果如下:
str.upper() : THIS IS WOW
实例扩展:
class A():scout
def go(lf):
print ("go A go!")
def stop(lf):
print ("stop A stop!")
def pau(lf):
rai Exception("Not Implemented")
class B(A):
def go(lf):
super(B, lf).go()
take it to the head
print ("go B go!")
class C(A):
def go(lf):
super(C, lf).go()
print ("go C go!")
nuldef stop(lf):
super(C, lf).stop()
print ("stop C stop!")
class D(B,C):
def go(lf):
super(D, lf).go()
print ("go D go!")
def stop(lf):
super(D, lf).stop()
print ("stop D stop!")
def pau(lf):
print ("wait D wait!")
深圳地址
aicibaclass E(B,C):
pass
a = A()
b = B()
c = C()
d = D()
e = E()
# 说明下列代码的输出结果
<()
print('--------')
什么是不及物动词<()
print('--------')
<()
print('--------')
<()
print('--------')
<()
print('--------')
a.stop()
print('--------')
b.stop()
print('--------')
c.stop()
print('--------')
d.stop()
print('--------')sour是什么意思
e.stop()
())
a.pau()
b.pau()
c.pau()
d.pau()
e.pau()
到此这篇关于python中upper是做什么⽤的的⽂章就介绍到这了,更多相关python中upper的作⽤内容请搜索以前的⽂章或继续浏览下⾯的相关⽂章希望⼤家以后多多⽀持!