Python Turtle Code: Rotating Trapezoid

Publicado em: 07 Fevereiro 2022
no canal de: Basic Python Turtle Art
210
2

A spirograph created by 15 trapezoids stamped as images of a rotating figure. The Python Turtle code uses a loop. The "normal" orientation of the turtle in this case is facing the first side of the last trapezoid drawn.

Please feel free to copy and paste the following code. Ask questions if you have any, and subscribe. Enjoy!!
import turtle
scrin = turtle.Screen()
scrin.bgcolor("light green")
t = turtle.Turtle()
t.pensize(5)
t.speed(3)
for i in range(15): #draw 15 trapezoids, 24 degrees apart
t.color("blue")
t.forward(250)
t.left(120)
t.color("black")
t.forward(100)
t.left(60)
t.color("red")
t.forward(150)
t.left(60)
t.color("blue")
t.forward(100)
t.left(144) #new_trapezoid: rotate turtle 120 + 24 degrees
scrin.exitonclick()


Nesta página do site você pode assistir ao vídeo on-line Python Turtle Code: Rotating Trapezoid duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Basic Python Turtle Art 07 Fevereiro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 210 vezes e gostou 2 espectadores. Boa visualização!