这里用的也是最基本的字符串处理的一些函数和方法。
理论还是比较简单的。
txt=input(‘输入文字’)
for t in txt:
if ‘a’<=t<=’z’:
print(chr(ord(a)-(ord(t)+ord(a)+3)%26),end=’’)
elif’A’<=t<=’Z’:
print(chr(ord(A)-(ord(t)+ord(A)+3)%26),end=’’)
elif’0xe400<=t<=0x9fa5:
print(chr(ord(t)+3),end=’’):
else:
print(t,end=’’)