亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Python string case conversion problem
天蓬老師
天蓬老師 2017-06-28 09:23:09
0
2
1399

str.lower() The string is all lowercase. str.upper() The string is all uppercase.

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

How can I make the stringcapitalize the first letter of each word? Make str = 'My World, My Python'

天蓬老師
天蓬老師

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

reply all(2)
僅有的幸福

Reference article: Issues related to Python string operations

String case conversion

str.lower() Strings are all lowercase.
str.upper() The string is all uppercase.
str.capitalize() Capitalize the first letter of the string.
str.title() The first letter of each word in the string is capitalized.

>>> 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
str.title()
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template