【发布时间】:2017-09-30 12:50:01
【问题描述】:
从this page.借来的random_turtle_color
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
【问题讨论】:
标签: python-2.7 random lambda colors turtle-graphics