s = input("请输入待转换的字符串: ") print(s.swapcase()) # 使用 swapcase 函数达到大小写互换的效果