4/03/2019

Colorful Hexagon in python

Colorful Hexagon in python

 
import turtle
colors=["green","orange","red","blue","purple","yellow"]
t=turtle.pen()
turtle.bgcolor("black")
turtle.speed(0) 
for i in range(250):
    turtle.pencolor(colors[i%6])
    turtle.width(i//100+1)
    turtle.forward(i)
    turtle.left(59)

No comments:

Post a Comment