Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 04. Food Order
- budget = float(input())
- tot_price = 2.50
- price = 0
- product_counter = 0
- while True:
- product = input()
- if product == "Order":
- break
- price = float(input())
- if price > budget:
- print(f"You will exceed the budget if you order this!")
- continue
- product_counter += 1
- tot_price += price
- budget -= price
- print(f"You ordered {product_counter} items!\nTotal: {tot_price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement