猫史档案馆


【Python作品分享】去太空,趣编程【作品秀】

用户:黑客天黑客天查看:0 回复:0 评论:0 创建时间:2021-05-01T10:46:07


【作品展示】

center_image

 

【作品介绍】

这个是我编成的!

 

【作品源代码】

import turtle
import random

__Pen = turtle.Pen()


#开始进入Python的世界
__Pen.pensize(5)
__Pen.showturtle()
turtle.bgcolor("#333399")
__Pen.pencolor("#ffcc00")
__Pen.fillcolor("#ffff00")
for __count in range(random.randint(10, 20)):
    星球 = random.randint((-300), 300)
    我 = random.randint((-300), 300)
    __Pen.penup()
    __Pen.goto(星球, 我)
    __Pen.pendown()
    __Pen.begin_fill()
    __Pen.circle(random.randint(15, 50))
    __Pen.end_fill()
    __Pen.penup()
__Pen.pencolor("#ffffff")
for __count in range(100):
    __Pen.goto(random.randint((-300), 300), random.randint((-300), 300))
    __Pen.pendown()
    __Pen.dot(5)
    __Pen.penup()
turtle.done()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页