Coding Spiral Art With Python

0
Coding Spiral Art With Python
Tweet about this on TwitterShare on FacebookPin on PinterestShare on LinkedInShare on Google+Share on TumblrEmail this to someoneShare on StumbleUponShare on RedditDigg this

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 1,881 times, 1 visits today)

Leave a Reply

Name
Name*
Email
Email *
Website
Website