Turtle is a very easy to use drawing library, concise and effective, drawing a five-pointed star only needs ten simple lines of code
import turtle as t
t.pensize(2) # 画笔大小
t.pencolor("gray") # 画笔颜色
t.fillcolor("gray") # 填充颜色
t.begin_fill()
After setting the parameters, traverse five times, and finally fill in the color
for _ in range(0, 5):
t.forward(300)
t.right(144)
t.end_fill()
t.mainloop() # 维持画布
Simple drawing is done