标签:inf 图片 src code span pre class print 文件操作
fr = open(‘plainText.txt‘,mode=‘r‘,encoding=‘utf-8‘) plainText = fr.read() print(plainText) print(‘密文:‘,end=‘‘) for c in plainText: print(chr(ord(c)+3),end=‘‘) fw =open(‘cipherText.txt‘,mode=‘a‘,encoding=‘utf-8‘) for c in plainText: print(chr(ord(c)+3),end=‘‘) fw.write(chr(ord(c)+3)) fr.close() fw.close()
标签:inf 图片 src code span pre class print 文件操作
原文地址:https://www.cnblogs.com/childish/p/9100772.html