摘要: 12 阅读全文
posted @ 2020-12-14 20:16 sxt。 阅读(83) 评论(0) 推荐(0)
摘要: 1 阅读全文
posted @ 2020-12-14 20:15 sxt。 阅读(33) 评论(0) 推荐(0)
摘要: import turtle, datetime def drawGap(): # 绘制数码管间隔 turtle.penup() turtle.fd(5) def drawLine(draw): # 绘制单段数码管 drawGap() turtle.pendown() if draw else tur 阅读全文
posted @ 2020-10-18 23:31 sxt。 阅读(298) 评论(0) 推荐(0)
摘要: 一.计算公式 二.代码实现如下 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("执行 阅读全文
posted @ 2020-10-09 17:21 sxt。 阅读(157) 评论(0) 推荐(0)
摘要: Python turtle学习心得 在Python实训周中,不但加深了以往对于Python基础语法的认识和运用,更重要的是,在原来的基础上,学到了新的东西。例如学会了Python基本图形绘制及turtle库的使用,这是Python学习上一个新的开始。首先,使用import turtle as 语句导 阅读全文
posted @ 2020-09-21 19:11 sxt。 阅读(630) 评论(0) 推荐(0)
摘要: import turtle as t t.pencolor("blue") t.fd(200) t.seth(120) t.fd(200) t.seth(-120) t.fd(200) t.seth(0) t.fd(100) t.seth(60) t.fd(100) t.seth(180) t.fd 阅读全文
posted @ 2020-09-14 21:20 sxt。 阅读(129) 评论(0) 推荐(0)
摘要: 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( 阅读全文
posted @ 2020-09-14 21:08 sxt。 阅读(254) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-09-14 20:04 sxt。 阅读(63) 评论(0) 推荐(0)