Completed 8-12 Sandwiches
This commit is contained in:
parent
ce16dab4d2
commit
09440d971b
20
Chapter_08/8-12_sandwiches.py
Normal file
20
Chapter_08/8-12_sandwiches.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Exercise 8-12 Sandwiches
|
||||||
|
# Learning Objective: Create a function that accepts arbitrary number of arguments.
|
||||||
|
|
||||||
|
order = []
|
||||||
|
|
||||||
|
ordering = True
|
||||||
|
print("Enter each ingredient one by one and hit enter. WHEN DONE type DONE to stop and process your order.")
|
||||||
|
while ordering == True:
|
||||||
|
sandwich_item = input("What can I add to your sandwich: \n")
|
||||||
|
if sandwich_item.lower() == 'done':
|
||||||
|
ordering = False
|
||||||
|
print("\tAdding {sandwich_item} to your sandwich...\n")
|
||||||
|
order.append(sandwich_item)
|
||||||
|
|
||||||
|
print(f"ORDER COMPLETE\nYou've ordered the following:\t")
|
||||||
|
for ingredient in order:
|
||||||
|
print(ingredient.lower())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user