画五角星(一)
from turtle import *
fillcolor("red")
begin_fill()
while True:
fd(200)
rt(144)
if abs (pos())<1:
break
end_fill()

画五角星(二)
from turtle import *
color("red","red")
begin_fill()
while True:
fd(200)
rt(144)
if abs (pos())<1:
break
end_fill()

画五角星(三)
import turtle
def main():
t = turtle.Turtle()
t.hideturtle()
lengthOfSize = 200
drawFivePointStar(t,0,0,lengthOfSize)
def drawFivePointStar(t,x,y,lengthOfSize):
t.up()
t.goto(x,y)
t.left(36)
t.down()
for i in range(5):
t.forward(lengthOfSize)
t.left(144)
main()

网友评论