Capitalizes the first letter of every word in a string.
Use s.title()
to capitalize first letter of every word in the string.
代码实现
def capitalize_every_word(s):
return s.title()
使用样例
capitalize_every_word('hello world!') # 'Hello World!'
Capitalizes the first letter of every word in a string.
Use s.title()
to capitalize first letter of every word in the string.
def capitalize_every_word(s):
return s.title()
capitalize_every_word('hello world!') # 'Hello World!'