摘要: 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(... 阅读全文
posted @ 2018-06-20 20:49 陈奕帆 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 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') 阅读全文
posted @ 2018-06-13 20:56 陈奕帆 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-06-06 21:40 陈奕帆 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2018-05-30 21:18 陈奕帆 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2018-05-23 21:10 陈奕帆 阅读(100) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle 阅读全文
posted @ 2018-05-16 20:39 陈奕帆 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 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, ... 阅读全文
posted @ 2018-05-09 20:30 陈奕帆 阅读(172) 评论(0) 推荐(0) 编辑
摘要: while True: a = int(input('摄氏温度换为华氏温度请按 1\n华氏温度转为摄氏温度请按 2\n退出请按 3\n')) if a==1: c = float(input('请输入摄氏温度:')) f = (c)*9/5+32 print('摄氏{:.2f}温度转为华氏温度是{: 阅读全文
posted @ 2018-04-25 21:49 陈奕帆 阅读(125) 评论(0) 推荐(0) 编辑
摘要: a=input('请输入一个数') b=input('再次输入一个数') sum1=int(a)+int(b) print('两个数之和{}'.format(sum1)) a=input('输入摄氏温度:') sum1=int(a) * 9/5 +32 print('华氏温度为{}'.format(sum1)) 阅读全文
posted @ 2018-04-18 21:45 陈奕帆 阅读(88) 评论(0) 推荐(0) 编辑
摘要: name1=input('请输入一个名字') name2=input('请输入一个连词') print('{}吃了一根香肠,{}吸了一根烟,他感到很满足'.format(name1,name2)) 阅读全文
posted @ 2018-04-18 21:08 陈奕帆 阅读(179) 评论(1) 推荐(0) 编辑