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 绘图

相关文章:

  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2021-12-21
  • 2021-07-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-10-21
  • 2021-07-14
  • 2022-12-23
  • 2021-05-19
相关资源
相似解决方案