码迷,mamicode.com
首页 > 其他好文 > 详细

文件操作

时间:2018-05-30 22:46:34      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:forward   .com   col   nbsp   code   image   ack   IV   speed   

技术分享图片

 

fr=open(‘马骝.txt‘,mode=‘r‘,encoding=‘utf-8‘)
plaincode=fr.read()
fr.close()

fw=open(‘大马骝.txt‘,mode=‘a‘,encoding=‘utf-8‘)
for c in plaincode:
    fw.write(chr(ord(c)+3))
fw.close()



import turtle

turtle.speed(20)
colors=[‘#B22222‘,‘#9A32CD‘,‘#32CD32‘,‘#00FFFF‘,‘#6B8E23‘,‘#4169E1‘]

for i in range(200):
    turtle.pencolor(colors[i% 6])
    turtle.forward(i)
    turtle.left(58)
turtle.done()


classmates = [‘Michael‘, ‘bob‘,‘tracy‘]
#print(len(classmates))
#print(classmates[-1])
(classmates).append(‘rose‘)
classmates.insert(1,‘jack‘)
classmates.pop()
classmates.pop(0)
classmates[0]=‘tom‘
print(classmates)

技术分享图片

 

文件操作

标签:forward   .com   col   nbsp   code   image   ack   IV   speed   

原文地址:https://www.cnblogs.com/mintine/p/9113720.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!