摘要:
geFile = open("ge.txt",mode="r",encoding='utf-8') geText = geFile.read() geFile.close() print(geText) replaceList = [',','.',"'",'\n'] for c in replaceList: geText = geText.replace(c,' ') print(... 阅读全文
摘要:
def hanoi(n,a,b,c): if n==1: print(n,a+'->'+c) else: hanoi(n-1,a,c,b) print(n,a+'->'+c) hanoi(n-1,b,a,c) hanoi(7,'A','B','C') 阅读全文
摘要:
l = ['QQ','WW','EE'] l.append('WW') l.pop() print(1) t = ('QQ','WW','EE') scores = [95,25,20] d = {'QQ':95,'WW':25,'EE':20} d['QQ'] = 44 d['WW'] = 55 阅读全文
摘要:
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',mo... 阅读全文
摘要:
id = '440882199902023256' area = id[0:6] birthday = id[6:14] sex = id [-2] print(area,birthday,sex) if (int(sex) % 2 == 0): print('girl') else: print('boy') for i in range(12): pri... 阅读全文
摘要:
import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle 阅读全文
摘要:
import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("red") turtle.begin_fill() turtle.circle(10, 180) turtle.circle(25, ... 阅读全文
摘要:
while True: a = int(input('摄氏温度换为华氏温度请按 1\n华氏温度转为摄氏温度请按 2\n退出请按 3\n')) if a==1: c = float(input('请输入摄氏温度:')) f = (c)*9/5+32 print('摄氏{:.2f}温度转为华氏温度是{: 阅读全文