歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Python upper() 函數 轉換為大寫字母

Python upper() 函數 轉換為大寫字母

日期:2017/3/1 9:33:34   编辑:Linux編程

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

--------------------------------------分割線 --------------------------------------

CentOS上源碼安裝Python3.4 http://www.linuxidc.com/Linux/2015-01/111870.htm

《Python核心編程 第二版》.(Wesley J. Chun ).[高清PDF中文版] http://www.linuxidc.com/Linux/2013-06/85425.htm

《Python開發技術詳解》.( 周偉,宗傑).[高清PDF掃描版+隨書視頻+代碼] http://www.linuxidc.com/Linux/2013-11/92693.htm

Python腳本獲取Linux系統信息 http://www.linuxidc.com/Linux/2013-08/88531.htm

在Ubuntu下用Python搭建桌面算法交易研究環境 http://www.linuxidc.com/Linux/2013-11/92534.htm

Python 語言的發展簡史 http://www.linuxidc.com/Linux/2014-09/107206.htm

Python 的詳細介紹:請點這裡
Python 的下載地址:請點這裡

Copyright © Linux教程網 All Rights Reserved