1、
>>> a = "gooD" ##测试字符串
>>> a.lower() ##全部变为小写
'good'
>>> a.upper() ## 全部变为大写
'GOOD'
>>> a.casefold() ## 全部变为小写
'good'
>>> a.capitalize() ## 首字母大写
'Good'
>>> a = "gooD"
>>> a.title() ## 首字母大写
'Good'
>>> a.capitalize()
'Good'
2、
>>> a = "gooD"
>>> a.upper()
'GOOD'
>>> a.lower()
'good'
>>> a.capitalize() ## 首字母大写
'Good'
>>> a.casefold()
'good'
>>> a.swapcase() ## 小写变大写,大写变小写
'GOOd'