大寫:
把所有字元轉換為大寫
str='hello woRld'
print(str.upper())
str='hello woRld'
print(str.upper())
HELLO WORLD
小寫:
把所有字元轉換成小寫
str='HELLO WOrld'
print(str.lower())
str='HELLO WOrld'
print(str.lower())
把第一個字母大寫,其餘小寫:
str='hello world'
print(str.capitalize())
str='hello world'
print(str.capitalize())
每個單詞的第一個字母大寫
把每個單詞的第一個字母轉化為大寫,其餘小寫
str='hello world'
print(str.title())
str='hello world'
print(str.title())