1. str.upper():转换为大写
2. str.lower():转换为小写
3. str.title():每一个单词的首字母大写
4. str.capitalize():字符串首字符大写
Example:
abc = " apple is not APPLE!"abcd = "apple is not APPLE!"print(abc.upper())print(abc.lower())print(abc.title())print(abc.capitalize())print(abcd.capitalize())
APPLE IS NOT APPLE!
apple is not apple!
Apple Is Not Apple!
apple is not apple!
Apple is not apple!