摘要: #1 small = open('The Young Salesman.txt',mode='r',encoding='utf-8') smallText = small.read() small.close() print(smallText) #2 replaceList =['?','!',' 阅读全文
posted @ 2018-06-20 21:31 BiuBiu怪 阅读(86) 评论(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(8,'A','B','C') 阅读全文
posted @ 2018-06-13 20:51 BiuBiu怪 阅读(77) 评论(0) 推荐(0) 编辑
摘要: fr = open('jay.txt',mode='r',encoding='utf-8') jay = fr.read() print('明文:'+jay) print('密文:',end='') fr.close() fw = open('hannah.txt',mode='a',encoding='utf-8') for c in jay: print(chr(ord(c)+3... 阅读全文
posted @ 2018-05-30 21:34 BiuBiu怪 阅读(85) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709090049' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '440301199808130621' print('省市是:'+IDNo[0:2]) print('生日是:'+IDNo[-8:-4]) print('性别是:'+IDNo... 阅读全文
posted @ 2018-05-23 21:13 BiuBiu怪 阅读(87) 评论(0) 推荐(0) 编辑
摘要: stuNum = '201709090049' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '440301199808130621' print('省市是:'+IDNo[0 阅读全文
posted @ 2018-05-23 19:35 BiuBiu怪 阅读(90) 评论(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:20 BiuBiu怪 阅读(91) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.pencolor('red') turtle.fillcolor('yellow') turtle.begin_fill() while True: turtle.forward(100) turtle.right(49) if abs(turtle.position())<1: break turtle.en... 阅读全文
posted @ 2018-05-09 21:11 BiuBiu怪 阅读(121) 评论(0) 推荐(0) 编辑
摘要: input('start') myNumber = 7 while True: guess = int(input()) if guess > myNumber: print('>') elif guess < myNumber: print ('<') else: print('') break ... 阅读全文
posted @ 2018-05-02 21:16 BiuBiu怪 阅读(82) 评论(0) 推荐(0) 编辑
摘要: a=int(input ('摄氏度转换为华氏度请按 1\n华氏度转换为摄氏度请按 2\n')) if a==1: c = float(input('请输入摄氏温度:')) f = c*9/5+32 print('{:.2f}°C转换成华氏温度为{:.2f}°F'.format(c,f)) else: 阅读全文
posted @ 2018-04-25 21:44 BiuBiu怪 阅读(109) 评论(0) 推荐(0) 编辑
摘要: >>> a = input('请输入第一个数: ') 请输入第一个数: 4 >>> print(a) >>> type(a) >>> type(4) >>> int(a)+2 a = input('输入摄氏度') sum2 = int(a) * 9/5+32 print('华氏温度 :{}'.format(sum2)) a = input('输入华氏温度') sum2 = 5*( ... 阅读全文
posted @ 2018-04-25 20:45 BiuBiu怪 阅读(101) 评论(0) 推荐(0) 编辑