Draw Squad in Python Using Turtle

Python Program to Draw Squad Using Turtle

#Python Program to Draw Squad Using Turtle

import turtle
import random

wn = turtle.Screen()
wn.bgcolor("black")
astroid = turtle.Turtle()
astroid.speed(0)
triad = turtle.Turtle()
triad.speed(0)
triad.up()
triad.goto(-120, 120)
triad.down()
squad = turtle.Turtle()
squad.speed(0)
squad.up()
squad.goto(120, 120)
squad.down()
pentago = turtle.Turtle()
pentago.speed(0)
pentago.up()
pentago.goto(-120, -120)
pentago.down()
octago = turtle.Turtle()
octago.speed(0)
octago.up()
octago.goto(120, -120)
octago.down()
colors = ["red", "gold", "blue", "green", "white", "cyan", "pink"]


for i in range(50):
    squad.color(random.choice(colors))
    squad.forward(i * 2)
    squad.left(90)


squad.up()
squad.goto(120, 180)
squad.down()
squad.write("Squad")
squad.hideturtle()


turtle.done()

Output:

About The Author

Leave a Reply