字符串反码A

while True:
    try:
        string=input()
        if string!="!":
            res=""
            for i in string:
                if i.isupper():
                    res+=chr(ord("Z")-(ord(i)-ord("A")))
                elif i.islower():
                    res += chr(ord("z") - (ord(i) - ord("a")))
                else:
                    res+=i
            print(res)
    except:
        break

 

posted @ 2020-03-22 17:40  liuchun玲  阅读(284)  评论(0编辑  收藏  举报