输入一个字符串,将大写转化成小写,将小写转化成大写,让后输出。
时间: 2024-06-01 19:12:49 浏览: 30
Sure thing! Here's a Python code that can do that:
input_str = input("Enter a string: ")
output_str = ""
for char in input_str:
if char.islower():
output_str += char.upper()
elif char.isupper():
output_str += char.lower()
else:
output_str += char
print("Output string: ", output_str)
Hope that helps!
相关推荐
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)