摘要: count=0def hanoi(n,A,C,B): global count if n==1: print("{}:{}->{}".format(1,A,C)) count+=1 else: hanoi(n-1,A,B,C) print("{}:{}->{}".format(1,A,C)) cou 阅读全文
posted @ 2020-03-29 21:28 Lysim 阅读(89) 评论(0) 推荐(0)
摘要: from random import randomimport mathimport timeDARTS=1000000hits=0.0for i in range(1,DARTS): x,y=random(),random() dist=math.sqrt(x**2+y**2) if dist<= 阅读全文
posted @ 2020-03-23 21:39 Lysim 阅读(96) 评论(0) 推荐(0)
摘要: #请替换括号中的提示性文字使程序可运行 import turtle turtle.pensize(3)turtle.pencolor("yellow")turtle.fillcolor("red") turtle.begin_fill()for i in range(5): turtle.forwa 阅读全文
posted @ 2020-03-11 21:03 Lysim 阅读(179) 评论(0) 推荐(0)
摘要: import turtleturtle.setup(650,350,200)turtle.penup()turtle.fd(-250)turtle.pendown()turtle.fillcolor("red")turtle.begin_fill()for i range(5): turtle.fd 阅读全文
posted @ 2020-03-11 16:28 Lysim 阅读(157) 评论(0) 推荐(0)