#循环输入10个字符,大写转小写,小写转大写,其它字符不变,然后输出

c=str(input('请输入10个字符:'))
for i in c:
    if i.isupper():
        print(i.lower(),end='')
    elif i.islower():
        print(i.upper(),end='')
    else:
        print(i,end='')

#请输入10个字符:aaasssddd!
#AAASSSDDD!

猜你喜欢

转载自blog.csdn.net/weixin_43788061/article/details/84671317