凯撒密码

s = input('明文:')
for c in s:
    print(chr(ord(c)+3),end='')
明文:i love you
l#oryh#|rx
Process finished with exit code 0
s = input('密文:')
for c in s:
    print(chr(ord(c)-3),end='')
密文:l#oryh#|rx
i love you
Process finished with exit code 0

 

posted @ 2018-05-23 21:09  Milliezhu  阅读(138)  评论(0编辑  收藏  举报