标签:enc div sar col bsp style encoding 文件 write
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=‘‘)
fr = open(‘letter.txt‘, mode=‘r‘, encoding=‘utf-8‘) plaincode = fr.read() fr.close() fw = open(‘a_letter.txt‘, mode=‘a‘, encoding=‘utf-8‘) for c in plaincode: fw.write(chr(ord(c)+3)) fw.close()
fr = open(‘a_letter.txt‘, mode=‘r‘, encoding=‘utf-8‘) plaincode = fr.read() fr.close() fw = open(‘letter.txt‘, mode=‘a‘, encoding=‘utf-8‘) for c in plaincode: fw.write(chr(ord(c)-3)) fw.close()
import turtle colors= [‘#B03060‘,‘#9B30FF‘,‘#CD6889‘,‘#8470FF‘,‘#DB7093‘,‘#EE5C42‘] turtle.speed(10) for i in range(150): turtle.pencolor(colors[i% 6]) turtle.forward(i) turtle.left(59) turtle.done()
classmates = [‘Micheel‘,‘Bob‘,‘Tracy‘] #print(len(classmates)) #print(classmates[1]) classmates.append(‘Tom‘) classmates.insert(1, ‘Jack‘) classmates.pop() classmates.pop(1) classmates[1] = ‘Sarah‘ print(classmates)
标签:enc div sar col bsp style encoding 文件 write
原文地址:https://www.cnblogs.com/12j-x/p/9113718.html