sandwich_orders = ['bacon_egg_sandwich', 'ham_egg_sandwich', 'lettuce_ham_egg_sandwich'] # count = len(sandwich_orders) # finished_sandwich = [] # while count > 0: # finish_sandwich = sandwich_orders.pop() # finished_sandwich.append(finish_sandwich) # print('I made your %s sandwich!' %(finish_sandwich)) # count -= 1 # print(finished_sandwich) # print(sandwich_orders) count = 0 finished_sandwich = [] active = True while active:if count < 3:sandwich_orders.append('pastrami')count += 1if 'pastrami' in sandwich_orders:ve('pastrami')finished_sandwich.append(sandwich_orders.pop())if len(sandwich_orders) == 0:break print(finished_sandwich)
本文发布于:2024-02-02 23:12:23,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170688674047078.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |