其他分享
首页 > 其他分享> > 六角形

六角形

作者:互联网

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()

标签:turtle,f1,right,180,tl,六角形,fill
来源: https://www.cnblogs.com/R-jiushu/p/12489978.html