#按照要求创建一个包含各种三明治名为sandwich_orders的列表
sandwich_orders = ['Black Forest Ham','pastrami','Cold Cut Combo','Italian B.M.T.','pastrami','Oven Roasted Chicken','Roast Beef','pastrami','Spicy Italian','Steak & Cheese','Subway Club','pastrami','Classic Tuna','Turkey Breast','Veggie Delite']
#在创建一个名为finished_sandwiches的空列表
finished_sandwiches = []
# 五香烟熏牛肉买完了
print(f'nThe pastrami is sell up!')
#遍历列表sandwich_orders,并删除里面的五香烟熏牛肉三明治
while 'pastrami' in sandwich_orders:ve('pastrami')
print(sandwich_orders)
#遍历列表sandwich_orders,并对其中每种三明治都打印一条消息
while sandwich_orders:current_orders = sandwich_orders.pop()print(f'nI made your {current_orders}!')finished_sandwiches.append(current_orders)
#对已经添加进finished_sandwiches列表的元素进行倒序打印!使其
#与sandwich_orders列表元素排列一致
verse()
print(f'n---All Sandwiches are finished--- ')
for finished_sandwich in finished_sandwiches:print(finished_sandwich.title())
本文发布于:2024-02-02 23:11:31,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170688669247074.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |