摘要: #1. hryFile = open('hry.txt',mode='r',encoding='utf-8') hryText = hryFile.read() hryFile.close() print(hryText) #2. replaceList = [',',"'",'-','\n'] for c in replaceList: hryText = hryText.repla... 阅读全文
posted @ 2018-06-20 20:38 hry丿 阅读(93) 评论(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(6,'A','B','C') 阅读全文
posted @ 2018-06-13 21:02 hry丿 阅读(90) 评论(0) 推荐(0) 编辑
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,65,45] d = {'Michael':95,'Bob':65,'Tracy':45 阅读全文
posted @ 2018-06-06 21:25 hry丿 阅读(113) 评论(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 阅读全文
posted @ 2018-05-30 20:50 hry丿 阅读(143) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709090003' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '440802199707180017' print('省市是:'+IDNo[0 阅读全文
posted @ 2018-05-23 20:25 hry丿 阅读(102) 评论(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:18 hry丿 阅读(106) 评论(0) 推荐(0) 编辑
摘要: import turtle #画一个五角星 turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward 阅读全文
posted @ 2018-05-09 20:21 hry丿 阅读(190) 评论(0) 推荐(0) 编辑
摘要: while True: guess = int(input()) if guess > myNumber: print('>') elif guess >> 3>2 True >>> 3==2 False >>> 3>> 阅读全文
posted @ 2018-05-02 20:54 hry丿 阅读(98) 评论(0) 推荐(0) 编辑
摘要: a=input('请输入华氏温度') sum2=int(a)*5/9-32 print('转换的摄氏温度是;{}'.format(sum2)) a=input('请输入摄氏温度') sum2=int(a)*5/9+32 print('转换的华氏温度是;{}'.format(sum2)) 阅读全文
posted @ 2018-04-25 20:39 hry丿 阅读(98) 评论(0) 推荐(0) 编辑