猫史档案馆


【Python作品分享】汉堡【作品秀】

用户:第一名的柒第一名的柒查看:0 回复:0 评论:0 创建时间:2022-05-29T16:19:25


【作品展示】

center_image

 

【作品介绍】

自己看

 

【作品源代码】

import turtle as p

p.left(90)
p.hideturtle()
p.fillcolor('tan1')
p.begin_fill()
p.circle(60)
p.end_fill()

num = int(input('需要几层汉堡?'))
if (num > 0):
    print('开始点餐')
else:
    print('至少要一层汉堡')
i = 0
while (i < num):
    extra = input('输入y加牛排,输入其它内容加番茄')
    if (extra == 'y'):
        color = 'saddle brown'
    else:
        color = 'tomato'
    p.penup()
    p.forward(7)
    p.pendown()
    p.fillcolor(color)
    p.begin_fill()
    p.circle(60)
    p.end_fill()
    i = (i + 1)
p.penup()
p.forward(7)
p.pendown()
p.fillcolor('tan1')
p.begin_fill()
p.circle(60)
p.end_fill()

p.ht()
p.done()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页