User:-Python turtle graphics-/flower hexagon: Difference between revisions
Luisa Moura (talk | contribs) No edit summary |
Luisa Moura (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
==flower hexagon== | ==flower hexagon== | ||
[[Flower hexagon.jpg]] | [[File:Flower hexagon.jpg|thumbnail]] | ||
<source lang="python"> | <source lang="python"> |
Revision as of 08:11, 7 October 2013
flower hexagon
<source lang="python">
import turtle
import random
def hexagon(angle,size):
angle=60
for i in range(6):
turtle.forward(size)
turtle.left(angle)
def drawing(size):
for i in range(18):
print hexagon(60,size)
turtle.left(20)
while(1):
print drawing(random.randint(40,100))
turtle.color(random.randint(0,1),random.randint(0,1),random.randint(0,1))
turtle.width(random.randint(1,2))
turtle.exitonclick()