当前位置:首页 > Python教程 > python进阶

Python3 upper()方法

python3 upper()方法

python3 字符串

描述

python upper() 方法将字符串中的小写字母转为大写字母。

语法

upper()方法语法:

str.upper()

参数

  • na。

返回值

返回小写字母转为大写字母的字符串。

实例

以下实例展示了 upper()函数的使用方法:

#!/usr/bin/python3

str = "this is string example from 51frw....wow!!!";

print ("str.upper() : ", str.upper())

以上实例输出结果如下:

str.upper() :  this is string example from 51frw....wow!!!


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!