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

文件操作,列表实例NiceHexSpiral

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

标签:图片   read   yellow   col   mod   txt   spi   gre   int   

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

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

技术分享图片

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

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

技术分享图片

文件操作,列表实例NiceHexSpiral

标签:图片   read   yellow   col   mod   txt   spi   gre   int   

原文地址:https://www.cnblogs.com/AN23/p/9113684.html

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