首页 > 其他 > 详细

六角形

时间:2020-03-14 00:54:49      阅读:71      评论:0      收藏:0      [点我收藏+]

import turtle

L=50
N=6
jiaodu=180-360/(N)
tl=turtle.Turtle()
#tl.speed(0)
tl.screen.delay(0)

def f1():
tl.fillcolor("yellow")
tl.begin_fill()
for i in range(3):
tl.fillcolor()
tl.forward(L)
tl.right(120)
tl.end_fill()

for i in range(N):
tl.left(jiaodu)
tl.penup()
tl.forward(L)
tl.pendown()
tl.right(180)
f1()

六角形

原文:https://www.cnblogs.com/R-jiushu/p/12489978.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!