1-Python - 画五角星

效果

代码示例

import turtle
import time

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

turtle.begin_fill()

for _ in range(5):
    turtle.forward(200)
    turtle.right(144)
turtle.end_fill()
time.sleep(2)

turtle.penup()
turtle.goto(-150, -120)
turtle.color("violet")
turtle.write("Done", font=('Arial', 40, 'normal'))
time.sleep(2)

that's all, see also:

10分钟轻松学会 Python turtle 绘图

posted @ 2019-02-26 18:08  听雨危楼  阅读(387)  评论(0编辑  收藏  举报