5 shapes polygons and a star using Python turtle |

Published: 16 July 2022
on channel: codeaj
112
6

5 shapes polygons and a star using Python turtle | #Ajcoding #python #pythonturtle #turtle:
Five_shapes (polygons and a star- sort of)
Source Code:
#Five_shapes(polygons and a star- sort of)
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):
triad.color(random.choice(colors))
triad.forward(i * 3)
triad.left(120)
for i in range(50):
squad.color(random.choice(colors))
squad.forward(i * 2)
squad.left(90)
for i in range(50):
pentago.color(random.choice(colors))
pentago.forward(i * 2)
pentago.left(72)
for i in range(75):
octago.color(random.choice(colors))
octago.forward(i)
octago.left(60)
for i in range(50):
astroid.color(random.choice(colors))
astroid.forward(i * 3)
astroid.left(144)
triad.up()
triad.goto(-110, 200)
triad.down()
triad.write("Triad")
triad.hideturtle()
squad.up()
squad.goto(120, 180)
squad.down()
squad.write("Squad")
squad.hideturtle()
pentago.up()
pentago.goto(-140, -20)
pentago.write("Pentago")
pentago.hideturtle()
octago.up()
octago.goto(120, -40)
octago.down()
octago.write("Hex")
octago.hideturtle()
astroid.up()
astroid.goto(0, 60)
astroid.down()
astroid.write("Astroid")
astroid.hideturtle()
turtle.done()

Tags:
Code a Star Tutorial,Spiraling Star Pattern using Turtle Graphic in Python,Creating random polygons,Python Turtle Graphics Drawing Multiple Shapes,draw a circle in python,Turtle Python programming,turtle graphics in python,star pattern in turtle,tar pattern in python,spiral star pattern,computer programming,PyScripter Turtle Graphics,Running a Turtle program in python,how to draw a star in python,Python Beginners Tutorial Learn Python,ython turtle module tutorial


On this page of the site you can watch the video online 5 shapes polygons and a star using Python turtle | with a duration of hours minute second in good quality, which was uploaded by the user codeaj 16 July 2022, share the link with friends and acquaintances, this video has already been watched 112 times on youtube and it was liked by 6 viewers. Enjoy your viewing!