当前位置:Gxlcms > Python > Python写的英文字符大小写转换代码示例

Python写的英文字符大小写转换代码示例

时间:2021-07-01 10:21:17 帮助过:90人阅读

几行代码的小工具,用于进行如下转换

TRANSACTIONS ON CLOUD COMPUTING

=》

Transactions On Cloud Computing

代码如下:


orig = 'TRANSACTIONS ON CLOUD COMPUTING'
splited = orig.split(' ')
handled = ''
for word in splited:
word = word[0] + word[1:].lower()
handled += (' ' + word)
handled = handled[1:]
print handled
#handled is 'Transactions On Cloud Computing'

人气教程排行