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
- product = input()
- while product != "Order":
- price = float(input())
- product_counter += 1
- tot_price += price
- if tot_price > budget:
- print(f"You will exceed the budget if you order this!")
- tot_price -= price
- product_counter -= 1
- product = input()
- print(f"You ordered {product_counter} items!\nTotal: {tot_price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement