1、capitalize() 与 title() 区别
capitalize(): 字符串第一个字母大写
title(): 字符串内的所有单词的首字母大写
a="i say hello to you"
print(a.title()) # 'I Say Hello To You'
print(a.capitalize()) # 'I say hello to you'
2024-01-10 14:55:16
1、capitalize() 与 title() 区别
capitalize(): 字符串第一个字母大写
title(): 字符串内的所有单词的首字母大写
a="i say hello to you"
print(a.title()) # 'I Say Hello To You'
print(a.capitalize()) # 'I say hello to you'