字符串(str)
大小写相关
upper()
有返回值,返回值为一个新的字符串
全部转大写
str1 = 'helLo World'
str2 = str1.upper()
print(str2) # HELLO WORLD
lower()
有返回值,返回值为一个新的字符串
全部转小写
str1 = 'helLo World'
str2 = str1.lower()
print(str2) # hello world
有返回值,返回值为一个新的字符串
全部转大写
str1 = 'helLo World'
str2 = str1.upper()
print(str2) # HELLO WORLD
有返回值,返回值为一个新的字符串
全部转小写
str1 = 'helLo World'
str2 = str1.lower()
print(str2) # hello world