s = input()
for c in s:
if ‘a‘ <= c <= ‘z‘:
print(chr(ord(‘z‘)-(ord(c)-ord(‘a‘))),end=‘‘)
elif ‘A‘ <= c <= ‘Z‘:
print(chr(ord(‘Z‘)-(ord(c)-ord(‘A‘))),end=‘‘)
else:
print(c,end=‘‘)
原文:https://www.cnblogs.com/shizihao/p/15267454.html