猫史档案馆


【Python作品分享】火箭[去太空,趣编程]

用户:美丽人生o8aZ美丽人生o8aZ查看:0 回复:1 评论:0 创建时间:2021-05-05T18:44:28


【作品展示】

center_image

 

【作品介绍】

我用了python编程工具,完成了火箭的绘画设计。

 

【作品源代码】

import turtle
a = turtle.Pen()
a.pencolor("red")
a.begin_fill()
a.fillcolor("red")
#火箭主体
a.forward(30)
a.left(90)
a.forward(150)
a.left(90)
a.forward(30)
a.left(90)
a.forward(150)
a.backward(150)
a.right(180)
#火箭左侧侧翼

a.goto(0,30)
a.left(90)
a.forward(50)
a.right(90)
a.forward(15)
a.right(90)
a.forward(50)

# 火箭右侧侧翼

a.penup()
a.goto(30,45)
a.pendown()
a.forward(50)
a.right(90)
a.forward(15)
a.right(90)
a.forward(50)

# 火箭尾部
a.left(90)
a.forward(30)
a.left(30)
a.forward(20)
a.right(120)
a.forward(50)
a.right(120)
a.forward(20)

# 火箭顶部
a.left(30)
a.goto(0,150)
a.right(23)
a.forward(40)
a.right(120)
a.goto(30,150)
a.end_fill()
a.hideturtle()
turtle.done()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
去世的细胞去世的细胞

你这是V1导弹不是火箭

点赞0


评论