From 953d34767d6e00dc2fead08b19095da61ede32f8 Mon Sep 17 00:00:00 2001 From: Donald Calloway Date: Fri, 17 Oct 2025 11:59:00 -0700 Subject: [PATCH] Adding concession_stand.py --- concession_stand.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 concession_stand.py diff --git a/concession_stand.py b/concession_stand.py new file mode 100644 index 0000000..ec49778 --- /dev/null +++ b/concession_stand.py @@ -0,0 +1,33 @@ +# Concession Stand Program + +menu = {"pizza": 1.50, + "soda": 2.00, + "popcorn": 6.00, + "pretzel": 2.50, + "candy bar": 0.90, + "hotdog": 2.75} + +cart = [] +total = 0 + +print("------------ MENU------------ ") +for key, value in menu.items(): + print(f"{key:15} ${value:.2f}") +print("------------------------------") + + +while True: + food = input("Select items from the menu (q to quit) ").lower() + if food == 'q': + break + elif menu.get(food) is not None: + cart.append(food) + + +print() +print("------------CART------------- ") +for food in cart: + print(food, end=" ") + total += menu.get(food) +print(f"\nYour total: ${total:.2f}") + \ No newline at end of file