Python 字符串方法
將小寫字母大寫,大寫字母小寫:
txt = "Hello My Name Is Elon" x = txt.swapcase() print(x)
運行實例
swapcase() 方法返回一個字符串,其中所有大寫字母均成為小寫字母,反之亦然。
string.swapcase()
無參數.