upper()函数python字符串内置方法
upper()方法描述
upper()方法,也是python中内置的一个字符串的方法,调用的python对象应当是python的字符串,不接收参数,通过str.upper()方式进行引用,返回值为调用对象str的大写形式。
upper()方法参数
无,通过str.upper()形式进行调用;
upper()方法返回值
注意:upper()方法返回的是新的大写形式的字符串,并不修改原字符串(调用对象)的值;
upper()方法实例代码
>>> web='笨鸟工具,x1y1z1.com'
>>> web.upper()
'笨鸟工具,X1Y1Z1.COM'
>>> web
'笨鸟工具,x1y1z1.com'