根据笔记泵上面的规律,就是每个字母向后移动两个位置,但是y-->a , z-->b
有了这个思路就可以进行代码编程解决了
#破解凯撒密码
with open("text.txt") as txt : # 引入密文存放文件text.txt
line=txt.readline() #把你想转换的放在一行
little=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
big=[]
for i in little:
big.append(i.upper())
# 将小写和大写引入
for i in line:
if i==' ':
print(' ',end='')
elif i=='.':
print('.',end='')
elif i=='y':
print('a', end="")
elif i == 'z':
print('b', end="")
else:
res = ord(i) + 2
print(chr(res), end="")
'''
g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp
. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle.
sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.
i hope you didnt translate it by hand. thats what computers are for.
doing it in by hand is inefficient and that)s why this text is so long.
using string.maketrans() is recommended. now apply on the url.
'''
其实这里还是有些瑕疵的,但是已经够解决这个问题的了,欢迎大牛指点补充哦!!