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!!!

云海天教程网,大量的免费python学习资料,欢迎在线学习!

来源:PY学习网:原文地址:https://www.py.cn/article.html

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » python的upper函数怎么用