填充颜色使用的默认模式1.0,所以就直接用random随机函数,如果turtle.colormode(255)则请使用randint函数,或者直接自定定好颜色列表导入
# encoding:utf-8
import turtle
from random import random
def draw_square(r):
t.fillcolor(random(), random(), random()
填充颜色使用的默认模式1.0,所以就直接用random随机函数,如果turtle.colormode(255)则请使用randint函数,或者直接自定定好颜色列表导入
# encoding:utf-8
import turtle
from random import random
def draw_square(r):
t.fillcolor(random(), random(), random()