用户:python爱好者恺恺查看:0 回复:0 评论:0 创建时间:2023-08-24T23:27:15
import turtle
import random
t = turtle.Pen()
colors = ["red","yellow","blue","green","orange","purple","gray","white"]
t.speed(1000)
turtle.bgcolor("black")
def paintbrush(x,y):
a = random.randint(0,7)
b = random.randint(0,50)
t.pencolor(colors[a])
t.fillcolor(colors[a])
t.penup()
t.goto(x,y)
t.pendown()
t.begin_fill()
t.circle(b)
t.end_fill()
turtle.onscreenclick(paintbrush)
exit = input("按下回车键,离开源码世界……")