文件操作,列表实例NiceHexSpiral
Posted 余君妍
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了文件操作,列表实例NiceHexSpiral相关的知识,希望对你有一定的参考价值。
fr=open(\'0530.txt\',mode=\'r\',encoding=\'utf-8\') plaincode=fr.read() print(\'明文:\'+plaincode) print(\'密文:\',end=\'\') for c in plaincode: print(chr(ord(c)+3),end=\'\')
fr = open(\'0530.txt\',mode=\'r\',encoding=\'utf-8\') plaincode = fr.read() fr.close fw = open(\'c_0530.txt\',mode=\'a\',encoding=\'utf-8\') for c in plaincode: fw.write(chr(ord(c)+3)) fw.close
fr = open(\'0530.txt\',mode=\'r\',encoding=\'utf-8\') plaincode = fr.read() fr.close fw = open(\'c_0530.txt\',mode=\'a\',encoding=\'utf-8\') for c in plaincode: fw.write(chr(ord(c)-3)) fw.close
import turtle colors=[\'yellow\',\'red\',\'black\',\'blue\',\'purple\',\'orange\'] turtle.speed(10) for i in range(100): turtle.pencolor(colors[i%6]) turtle.forward(i) turtle.left(59) turtle.done()
以上是关于文件操作,列表实例NiceHexSpiral的主要内容,如果未能解决你的问题,请参考以下文章
Linear regression with one variable算法实例讲解(绘制图像,cost_Function ,Gradient Desent, 拟合曲线, 轮廓图绘制)_矩阵操作(代码片