猫史档案馆


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

用户:hgggglhggggl查看:0 回复:0 评论:0 创建时间:2021-05-05T21:12:14


【作品展示】

center_image

 

【作品介绍】

【去太空,趣编程】

 

【作品源代码】

import turtle as t
t.hideturtle()
t.speed(0)

def tblb(x, y):
    t.up()
    t.goto(x, y)
    t.down()

def hbys(c):
    t.pencolor(c)
    t.fillcolor(c)
    t.begin_fill()

def cfx(a, b):
    for i in range(2):
        t.fd(a)
        t.left(90)
        t.fd(b)
        t.left(90)
    t.end_fill()

tblb(-50, -100)
hbys('red')
cfx(100, 200)

hbys('purple')
tblb(-50, 100)
for i in range(3):
    t.fd(100)
    t.left(120)
t.end_fill()

tblb(-50, -195)
hbys('yellow')
cfx(20, 75)
hbys('yellow')

tblb(-10, -170)
cfx(20, 50)
hbys('yellow')

tblb(30, -195)
cfx(20, 75)
tblb(-20, 0)

t.write('编程号', font=('Arial', 12, 'normal'))

t.done()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页