python中upper是做什么用的

更新时间:2023-07-11 05:41:49 阅读: 评论:0

英国留学生政策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的作⽤内容请搜索以前的⽂章或继续浏览下⾯的相关⽂章希望⼤家以后多多⽀持!

本文发布于:2023-07-11 05:41:49,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/173871.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:字母   输出   相关   浏览   结果
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图