国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Python字符串轉(zhuǎn)大小寫問題
天蓬老師
天蓬老師 2017-06-28 09:23:09
0
2
1401

str.lower() 字符串全小寫。str.upper() 字符串全大寫。

>>> str = 'my world, MY PYTHON'
>>> str.lower()
'my world, my python'
>>> str.upper()
'MY WORLD, MY PYTHON'

如何才能使字符串每個(gè)單詞首字母都大寫? 使 str = 'My World, My Python'

天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進(jìn)步~~

全部回復(fù)(2)
僅有的幸福

參考文章:Python字符串操作相關(guān)問題

字符串大小寫轉(zhuǎn)換

str.lower() 字符串全小寫。
str.upper() 字符串全大寫。
str.capitalize() 字符串首字母大寫。
str.title() 字符串每個(gè)單詞首字母都大寫。

>>> str = 'my world, MY PYTHON'
>>> str.lower()
'my world, my python'
>>> str.upper()
'MY WORLD, MY PYTHON'
>>> str.capitalize()
'My world, my python'
>>> str.title()
'My World, My Python'
Peter_Zhu

雷雷

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板