猫史档案馆


【Python作品分享】端午节粽子(6.11)

用户:恬静的胆小菇1gDr恬静的胆小菇1gDr查看:0 回复:1 评论:0 创建时间:2021-06-12T10:46:53


【作品展示】

center_image

 

【作品介绍】

劣质粽子

 

【作品源代码】

import turtle


q = turtle.Pen()
q.pencolor("green3")
q.dot(200000)
# 粽叶1
q.pencolor('green')
q.fillcolor('green')
q.begin_fill()
i = 0
while (i < 3):
    q.left(120)
    q.forward(120)
    i = (i + 1)
q.end_fill()
# 馅
q.forward(10)
q.pencolor('Light yellow3')
q.fillcolor('Light yellow3')
q.begin_fill()
i = 0
while (i < 3):
    q.left(120)
    q.forward(120)
    i = (i + 1)
q.end_fill()
# 粽叶2
q.forward(10)
q.pencolor('green')
q.fillcolor('green')
q.begin_fill()
i = 0
while (i < 3):
    q.left(120)
    q.forward(120)
    i = (i + 1)
q.end_fill()
# 线
q.pencolor('red')
q.penup()
q.goto(15, 75)
q.pendown()
i = 0
while (i < 3):
    q.left((-170))
    q.forward(120)
    q.left(170)
    q.forward(120)
    i = (i + 1)
q.pencolor('green')
q.backward(15)
q.left(90)
q.forward(35)
q.pencolor("green3")
q.pensize(25)
q.forward(80)

q.end_fill()
q.hideturtle()
turtle.done()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
水翎稞水翎稞

大佬啊!来花幻工作室吧!https://shequ.codemao.cn/work_shop/5824 

点赞0


评论