#输入一串字符,将大写字母转换成小写字母,小写字母转换为大写字母 a = input("请 输入字符:") b = [] for n in a : if "a"<= n <= "z": b.append(n.upper()) elif"A" <= n <= "Z" : b.append(n.lower()) else: b.append(n) print("".join(b))
#输入一串字符,将大写字母转换成小写字母,小写字母转换为大写字母 a = input("请 输入字符:") b = [] for n in a : if "a"<= n <= "z": b.append(n.upper()) elif"A" <= n <= "Z" : b.append(n.lower()) else: b.append(n) print("".join(b))