Amazing pattern using python - turtle programming

Опубликовано: 07 Август 2026
на канале: Adi's Technical Aid
77
4

Code :
import turtle
import random

wn = turtle.Screen()
wn.bgcolor("black")
astroid = turtle.Turtle()
astroid.speed(0)

pentago = turtle.Turtle()
pentago.speed(0)
pentago.up()
pentago.goto(0, 0)
pentago.down()

colors = ["red", "gold", "blue", "green", "white", "cyan", "pink"]

for i in range(50):
pentago.color(random.choice(colors))
pentago.forward(i * 5)
pentago.left(72)



pentago.up()
pentago.goto(-140, -20)
pentago.hideturtle()


turtle.done()