Python写的大小写转换小工具

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

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'

 

posted @ 2015-02-17 22:42  KevinHwang  阅读(725)  评论(0编辑  收藏  举报