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

Hexagon Spiral with Python and Turtle (Source Code)

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

Hexagon Spiral

Source Code:

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

for i in range(10,780,3):
    turtle.fd(i)
    turtle.left(59.3)
Tags: ,

Related Post