一、程序
python
import turtle
def draw_star(size, color):
angle = 144
turtle.fillcolor(color)
turtle.begin_fill()
for side in range(5):
turtle.forward(size)
turtle.right(angle)
turtle.end_fill()
turtle.speed(1) # 设置绘图速度,1为最慢
draw_star(100, "yellow") # 绘制一个大小为100,颜色为黄色的五角星
turtle.done()
二、运行效果
