str1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxzy"
str2="YZXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba"
str=str(input(""))
for i in range(len(str)):
if str[i]==" ":
print(" ",end="")
else:
n=0 #特殊字符判断
j=0
for j in range(0,52):
if str[i]==str1[j]:
print(str2[j],end="")
n=1
if n==0:
print(str[i],end="")
原文:https://www.cnblogs.com/lyh1437929164/p/15270146.html