Python 2:str.title()(使字符串每个单词首字母大写)
1 name = "hello,world! hello,python!" 2 print(name.title()) #单词首字母大写
1 运行结果将会是:Hello,World!Hello,Python!
1 name = "hello,world! hello,python!" 2 print(name.title()) #单词首字母大写
1 运行结果将会是:Hello,World!Hello,Python!