Home > Backend Development > Python Tutorial > Python写的英文字符大小写转换代码示例

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

WBOY
Release: 2016-06-06 11:21:49
Original
1681 people have browsed it

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

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'

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template