mardi 2 mai 2017

How do I "hold" the randomly generated color?

random_turtle_color

borrowed from this page http://ift.tt/2oVgQFL

import turtle, random

r = lambda: random.randint(0,255) print('#%02X%02X%02X' % (r(),r(),r()))

turtle.width(10) #What does this line do? length = 5 for count in range(100): colors = (z) #I want the randomly generated hexadecimal color to be #the pen in the drawing turtle.speed(0) turtle.forward(length) turtle.right(135) length = length + 5




Aucun commentaire:

Enregistrer un commentaire