摘要: 1 count = 0 2 def hanoi(n, src, dst, mid): 3 global count 4 if n == 1: 5 print("{}:{}->{}".format(1,src,dst)) 6 count += 1 7 else : 8 hanoi(n-1, src, 阅读全文
posted @ 2020-03-29 19:15 ghhzaq 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1 import time 2 from random import random 3 DARTS = 1000*1000 4 hits = 0.0 5 for i in range(1, DARTS+1): 6 x, y = random(), random() 7 dist = pow(x ** 阅读全文
posted @ 2020-03-22 15:04 ghhzaq 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-03-11 20:02 ghhzaq 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 五角星 1 #wujioxin.py 2 import turtle 3 turtle.fillcolor("red") 4 turtle.begin_fill() 5 while True: 6 turtle.forward(220) 7 turtle.right(144) 8 if abs(tu 阅读全文
posted @ 2020-03-11 18:55 ghhzaq 阅读(1099) 评论(0) 推荐(0) 编辑