摘要: 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(11,'A','B','c') 阅读全文
posted @ 2018-06-13 21:03 Doshelly 阅读(87) 评论(0) 推荐(0) 编辑
摘要: l = ['leo','yao','y'] l.append('yao') l.pop() print(1) t = ('leo','yao','y') scores = [99,66,89] d = {'leo':99,'yao':66,'y':89} d['yao'] = 99 d['Rose' 阅读全文
posted @ 2018-06-06 21:24 Doshelly 阅读(93) 评论(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('ccc.txt',mode=... 阅读全文
posted @ 2018-05-30 21:28 Doshelly 阅读(102) 评论(0) 推荐(0) 编辑
摘要: id = '4406821999065206327' 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)... 阅读全文
posted @ 2018-05-23 20:56 Doshelly 阅读(86) 评论(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.goto(x,y) turtle.pendown() mygoto(... 阅读全文
posted @ 2018-05-16 20:42 Doshelly 阅读(141) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.bgcolor('red') turtle.pencolor('yellow') turtle.fillcolor('yellow') turtle.begin_fill() for i in range(5): turtle.forward(50) turtle.right(144) turtle.end_fill() ... 阅读全文
posted @ 2018-05-09 21:08 Doshelly 阅读(236) 评论(0) 推荐(0) 编辑
摘要: myPrice = 6 while True: guess = int(input()) if guess > myPrice: print('>') elif guess < myPrice: print('<') else: print('') break import turtle tu... 阅读全文
posted @ 2018-05-02 21:44 Doshelly 阅读(121) 评论(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}的华氏为{;.2f}') elif a==2: f = float(in... 阅读全文
posted @ 2018-04-25 21:39 Doshelly 阅读(243) 评论(0) 推荐(0) 编辑
摘要: a=input('请输入华氏温度') sum2=int(a)*5/9-32 print('转换的摄氏温度是;{}'.format(sum2)) a=input('请输入摄氏温度') sum2=int(a)*5/9+32 print('转换的华氏温度是;{}'.format(sum2)) a = input('请输入一个数字;') b = input('请输入一个数字;... 阅读全文
posted @ 2018-04-25 19:49 Doshelly 阅读(118) 评论(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 19:30 Doshelly 阅读(130) 评论(0) 推荐(0) 编辑