#python编程从入门到实践练习7

阅读: 评论:0

#python编程从入门到实践练习7

#python编程从入门到实践练习7

#按照要求创建一个包含各种三明治名为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小时内删除。

标签:入门   python
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23