凯撒密码

Posted millie

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了凯撒密码相关的知识,希望对你有一定的参考价值。

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

 

以上是关于凯撒密码的主要内容,如果未能解决你的问题,请参考以下文章