品易云推流 关闭
文章详情页
文章 > Python常见问题 > python的upper函数怎么用

python的upper函数怎么用

头像

silencement

2019-11-14 11:57:093523浏览 · 0收藏 · 0评论

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学习网,大量的免费python学习视频,欢迎在线学习!

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

底部广告图