Completed Exercise 7-9 No Pastrami

This commit is contained in:
cheeks 2025-02-06 08:17:19 -05:00
parent 10493c58d4
commit 7834473b85

View File

@ -0,0 +1,18 @@
# Exercise 7-9 No Pastrami
# Learning Objective: USe a loop to edit a list. Print list.
print('Sorry the deli has run out of pastrami...')
sandwich_orders = ['Ham and Swiss', 'Pastrami', 'Bologna and Cheese', 'Pastrami', 'Italian Combo', 'Chicken Parm', 'Pastrami']
finished_sandwiches = []
while sandwich_orders:
while 'Pastrami' in sandwich_orders:
sandwich_orders.remove('Pastrami')
sandwich = sandwich_orders.pop()
print(f"I made your {sandwich}")
finished_sandwiches.append(sandwich)
print(f"\nSandwiches made: ")
for sandwiches in finished_sandwiches:
print(f"{sandwiches}")