摘要: 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 21:26 itach宇智波鼬 阅读(85) 评论(0) 推荐(0) 编辑
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,75,85] d = {'Michael':95,'Bob':75,'Tracy':85 阅读全文
posted @ 2018-06-06 21:32 itach宇智波鼬 阅读(96) 评论(0) 推荐(0) 编辑
摘要: id='440682199901084345' 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(98... 阅读全文
posted @ 2018-05-23 21:15 itach宇智波鼬 阅读(87) 评论(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:53 itach宇智波鼬 阅读(92) 评论(0) 推荐(0) 编辑
摘要: import turtle #画一个五角星 turtle.bgcolor('red') turtle.pencolor('yellow') turtle.fillcolor('yellow') turtle.begin_fill() for i in range(5): turtle.forward 阅读全文
posted @ 2018-05-09 21:13 itach宇智波鼬 阅读(233) 评论(0) 推荐(0) 编辑