Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- name = input()
- budget = float(input())
- bottles_beer = int(input())
- paquets_chips = int(input())
- price_beer = bottles_beer * 1.20
- percentage = price_beer * 0.45
- price_chips = math.ceil(paquets_chips * percentage)
- total_price = price_beer + price_chips
- if total_price <= budget:
- print(f"{name} bought a snack and has {budget - total_price:.2f} leva left.")
- else:
- print(f"{name} needs {total_price - budget:.2f} more leva!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement