Adding ShoppingCartProgram.py

This commit is contained in:
Donald Calloway 2025-10-16 09:58:25 -07:00
parent b1ad66d4f9
commit 66229a6155

25
ShoppingCartProgram.py Normal file
View File

@ -0,0 +1,25 @@
# Shopping Cart Program
foods = []
prices = []
total = 0
while True:
food = input("Enter a food item (q to quit): ")
if food.lower() == 'q':
break
else:
foods.append(food)
price = float(input("Enter a price $"))
prices.append(price)
total += price
print("----- YOUR CART ----")
for food in foods:
print(food)
print(f'\nYour total is: ${total}')