摘要:
一.计算公式 二.代码实现如下 def PI(n): pi=0 for k in range(n): pi += 1/pow(16,k)*(4/(8*k+1)-2/(8*k+4)-1/(8*k+5)-1/(8*k+6)) return piimport timescale = 20print("执行 阅读全文
摘要:
import turtle as t t.setup(650,350,200,200) #窗口大小及左上角位置 t.seth(30) #画笔起始方向 for i in range(6): t.fd(30) #六角形边长30 t.left(120) t.fd(30) t.left(120) t.fd( 阅读全文
摘要:
import turtle as t t.fillcolor("red") #颜色填充函数 t.begin_fill() while True: t.forward(200) t.right(144) if abs(t.pos()) < 1:#看画笔是否回到原点,回到原点为真 break t.end 阅读全文