Coding Spiral Art With Python

0
Coding Spiral Art With Python

The following spiral art can be coded using python. It’s a simple script that can easily be manipulated to explore how different number variables will change the spiral.

import turtle
colors=[‘red’, ‘purple’, ‘blue’, ‘green’, ‘orange’, ‘yellow’]
t=turtle.Pen()
turtle.bgcolor(‘black’)
for x in range (360) :
t.pencolor(colors[x%6])
t.width(x/100+1)
t.forward(x)
t.left(59)

Screen Shot 2016-02-11 at 7.57.28 AM

(Visited 13,221 times, 1 visits today)

Leave a Reply

Name
Name*
Email
Email *
Website
Website