#FivePointStar.py
from turtle import *
pensize(5)
pencolor('green')
fillcolor('red')
begin_fill()
while True:
fd(200)
right(144)
if abs(pos()) <1:
break
end_fill()
做好运行点击,如图run

运行结果如下

这样用python做的五角星就出来了。
#FivePointStar.py
from turtle import *
pensize(5)
pencolor('green')
fillcolor('red')
begin_fill()
while True:
fd(200)
right(144)
if abs(pos()) <1:
break
end_fill()
做好运行点击,如图run
运行结果如下
这样用python做的五角星就出来了。