Python upper() 函数 转换为大写字母

2015-02-13 18:23:48 · 作者: · 浏览: 41

Python函数:upper()


1:作用:字符串中的小写字母转为大写字母。


2:语法:string.upper()


3:返回值:返回被转为大写字母的字符串


4:实例


>>> from string import upper
>>> s = "Hello Good Boy?Linuxidc 123456"
>>> print s.upper()
HELLO GOOD BOY?LINUXIDC 123456


--------------------------------------分割线 --------------------------------------