Python and Turtle Difficulty Level 2,for loop,loop,python Triangle Spiral with Turtle (Source Code)

Triangle Spiral with Turtle (Source Code)

Draw the following spiral with triangle shape. In each loop, increase the forward length and turn slightly less than 120 degrees.

Triangle Spiral with Python and Turtle

Source Code:

import turtle
screen = turtle.Screen()
screen.title('Triangle Spiral - PythonTurtle.Academy')
turtle.setup(1000,1000)
screen.setworldcoordinates(-1000,-1000,1000,1000)
turtle.speed(0)
turtle.hideturtle()

for i in range(10,1550,9):
    turtle.fd(i)
    turtle.left(119.3)
Tags: ,

Related Post