其他分享
首页 > 其他分享> > 画五角星

画五角星

作者:互联网

import turtle

turtle.pensize(5)
turtle.pencolor("yellow")
turtle.fillcolor("red")

turtle.begin_fill()
for i in range(0,5):
    turtle.forward(100)
    turtle.right(144)
    turtle.forward(100)
    turtle.left(72)
turtle.end_fill()

turtle.hideturtle()   #隐藏画笔
turtle.done()         #结束绘制

  

标签:turtle,144,right,五角星,forward,100,fill
来源: https://www.cnblogs.com/cnn-ljc/p/12496749.html