摘要: 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(10,'A','B','c') 阅读全文
posted @ 2018-06-13 20:50 SallyAu 阅读(115) 评论(0) 推荐(0) 编辑
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [85,65,55] d = {'Michael':85,'Bob':65,'Tracy':55} d['Bob'] = 82 d['Rose'] = 88 d.pop('Bob') p. 阅读全文
posted @ 2018-06-06 21:40 SallyAu 阅读(120) 评论(0) 推荐(0) 编辑
摘要: fr = open('ouou.txt',mode='r',encoding='utf-8') plaincode = fr.read() print('明文:' + plaincode) import turtle turtle.speed(10) colors=['blue','purple','yellow','#9B30FF','orange','red'] for i in ra... 阅读全文
posted @ 2018-05-30 21:22 SallyAu 阅读(138) 评论(0) 推荐(0) 编辑
摘要: id='440681195602212466' 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): print(9... 阅读全文
posted @ 2018-05-23 21:32 SallyAu 阅读(90) 评论(0) 推荐(0) 编辑
摘要: stuNum ='201709080A57' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:8]) print('序号是:'+stuNum[-2:]) personID ='440681199902122456' import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') t... 阅读全文
posted @ 2018-05-16 21:37 SallyAu 阅读(125) 评论(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() def draw5... 阅读全文
posted @ 2018-05-16 20:57 SallyAu 阅读(103) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.pencolor('yellow') turtle.fillcolor('green') turtle.begin_fill() while True: turtle.forward(100) turtle.right(155) if (abs(turtle.pos()))<1: break turtle.en... 阅读全文
posted @ 2018-05-09 21:42 SallyAu 阅读(91) 评论(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, 110)... 阅读全文
posted @ 2018-05-09 21:09 SallyAu 阅读(459) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.circle(50) turtle.circle(100) turtle.circle(150) import turtle turtle.filleolor('yellow') turtle.begin_fill() turtle.circle(50) turtle.end_fill() turtle.up() turtle.gote(0,-... 阅读全文
posted @ 2018-05-03 15:56 SallyAu 阅读(160) 评论(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}'.format(c,f)) el... 阅读全文
posted @ 2018-04-25 21:42 SallyAu 阅读(1977) 评论(0) 推荐(0) 编辑