用Python2710编写凯撒密码加密和解密程序
导读:用Python2710编写凯撒密码加密和解密程序?s = raw_input('[开始加密]please input your str:' s = list(s n = 0for sw in s:s[n] = chr(ord(sw +3 n...
用Python2710编写凯撒密码加密和解密程序?
s = raw_input('[开始加密]please input your str:')
s = list(s)
n = 0
for sw in s:
s[n] = chr(ord(sw)+3)
n = n + 1
sout = ''
for sw2 in s:
sout = sout + sw2
print '[加密结果]:',sout
解密的类似,主要用到ord、chr函数。
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: 用Python2710编写凯撒密码加密和解密程序
本文地址: https://pptw.com/jishu/59828.html
