文件操作
fr = open('qcj.txt',mode='r',encoding='utf-8') qcj = fr.read() print('明文:'+qcj) print('密文:',end='') fw = open('cipherText.txt',mode='a',encoding='utf-8') for c in qcj: print(chr(ord(c)+3),end='') fw.write(chr(ord(c)+3)) fr.close() fw.close()
name1 = 'Anny' name2 = 'Sylvia' classmates = ['Luna','Gran','Tom','Logo'] classmates.append('Alla') print(len(classmates),classmates)
name1 = 'Anny' name2 = 'Sylvia' classmates = ['Luna','Gran','Tom','Logo'] classmates.append('Alla') classmates.insert(1,'Vivi') classmates.pop() classmates.pop(4) print(len(classmates),classmates)