首页 > IT职业 > IT图书 > python的upper函数怎么用

Python upper() 方法将字符串中的小写字母转为大写字母。
upper()方法语法:
str.upper()
参数
NA。
返回值
返回小写字母转为大写字母的字符串。
实例
以下实例展示了 upper()函数的使用方法:
str = "this is string example....wow!!!"; print "str.upper() : ", str.upper()
输出结果
str.upper() : THIS IS STRING EXAMPLE....WOW!!!
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/200/viewspace-2835603/ ,如需转载,请注明出处,否则将追究法律责任。