猫史档案馆


【Python作品分享】随机画圆圈【作品秀】

用户:Illusionary_DaytimeIllusionary_Daytime查看:0 回复:5 评论:0 创建时间:2020-05-10T17:01:45


【作品展示】

center_image

 

【作品介绍】

动画

 

【作品源代码】

import turtle
import random
import time


t = turtle.Pen()
colors = ['red', 'yellow', 'blue', 'green', 'orange', 'purple', 'gray', 'white']

t.speed(100)
turtle.bgcolor('black')

for x in range(100):
    a = random.randint(0, 7)
    b = random.randint(0, 50)
    x = random.randint((-300), 300)
    y = random.randint((-300), 300)
    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()
time.sleep(3)

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
SMC小萌新SMC小萌新

看你没有工作室呢,考虑考虑加入我们吧,谢谢!

点赞0


评论


五个少女五个少女

要不要来我们超自由工作室啊

点赞0


评论


不起眼的账号不起眼的账号

center_image

没错我不用海龟

点赞0


评论


Illusionary_DaytimeIllusionary_Daytime

我是小学生各位,没空上线,学业负担重

点赞0


评论


Illusionary_DaytimeIllusionary_Daytime

不加入工作室呢,期末考试了

点赞0


评论