作业8

作业8_第1张图片

kk = open('plainText.txt',mode='r', encoding='utf-8')
plainText = kk.read()
print('明文:'+plainText)
print('密文:',end='')
for c in plainText:
    print(chr(ord(c)+3),end='')


for c in plainText:
    print(chr(ord(c)+3),end='')

 

fr = open('plainText.txt',mode='r',encoding='utf-8')
plainText = fr.read()


fw = open('cipherText.txt',mode='a',encoding='utf-8')
for c in plainText:

    fw.write(chr(ord)+3)

fr.close()
fw.close()

 

作业8_第2张图片

name1 = 'peter'
name2 = 'bobo'
classmates = ['peter','bobo','rickey','KK']
classmates.append('Thor')
classmates.insert(1,'simon')

classmates.pop()
classmates.pop(4)
classmates[0] = 'Thor'
print(len(classmates),classmates)

 

你可能感兴趣的:(作业8)