classmates = ['Michael','Bob','Tracy']
classmates.append('Rose')
classmates.insert(1,'Jack')
classmates.pop()
classmates.pop(0)
classmates[0] = 'Tom'
print(classmates)
![](https://images2018.cnblogs.com/blog/1380161/201805/1380161-20180530211325473-936099550.png)
import turtle
turtle.speed(10)
colors = ['red','purple','blue','green','yellow','orange']
for i in range(100):
turtle.pencolor(colors[i% 6])
turtle.forward(i)
turtle.left(59)
turtle.done()
![](https://images2018.cnblogs.com/blog/1380161/201805/1380161-20180530211817031-1944805939.png)
fr = open('letter.txt',mode='r',encoding='utf-8')
plaincode = fr.read()
print('明文:' + plaincode)
print('密文:',end='')
for c in plaincode:
print(chr(ord(c)+3),end='')
![](https://images2018.cnblogs.com/blog/1380161/201805/1380161-20180530204806492-145508072.png)
fr = open('letter.txt',mode='r',encoding='utf-8')
plaincode = fr.read()
fr.close
fw = open('c_letter.txt',mode='a',encoding='utf-8')
for c in plaincode:
fw.write(chr(ord(c)+3))
fw.close
![](https://images2018.cnblogs.com/blog/1380161/201805/1380161-20180530204932325-40393634.png)