ITPub博客

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

python的upper函数怎么用

IT图书 作者:disable 时间:2021-09-11 10:27:51 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学习视频,欢迎在线学习!

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/200/viewspace-2835603/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2018-09-12

  • 博文量
    86
  • 访问量
    16275