摘要:
一、计算方法 利用BBP公式计算圆周率: 二、算法实现 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 pi import time scale 阅读全文
摘要:
1、五角星的绘制 import turtle as t t.setup(650,350,-180,-180) t.fillcolor("red") t.begin_fill() for i in range(5): t.fd(150) t.right(145) t.end_fill() 2、六角形的 阅读全文