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

文件操作,列表实例NiceHexSpiral

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

标签:.com   技术   span   tle   close   txt   end   图片   range   

fr = open(‘jay.txt‘,mode=‘r‘,encoding=‘utf-8‘)
jay = fr.read()
print(‘明文:‘+jay)
print(‘密文:‘,end=‘‘)
fr.close()

fw = open(‘hannah.txt‘,mode=‘a‘,encoding=‘utf-8‘)
for c in jay:
     print(chr(ord(c)+3),end=‘‘)
fw.close()

技术分享图片

import turtle
turtle.speed(10)
colors = [‘#B0E2FF‘,‘blue‘,‘yellow‘,‘pink‘,‘green‘,‘orange‘]

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

技术分享图片

文件操作,列表实例NiceHexSpiral

标签:.com   技术   span   tle   close   txt   end   图片   range   

原文地址:https://www.cnblogs.com/biuabiu123/p/9113656.html

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