Advertisement
Spocoman

Beer and chips

Jan 5th, 2022
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import math
  2.  
  3. name = input()
  4. budget = float(input())
  5. beers = float(input()) * 1.2
  6. chips = float(input()) * beers * 0.45
  7. total = beers + math.ceil(chips)
  8.  
  9. if budget < total:
  10.     print(f'{name} needs {total - budget:.2f} more leva!')
  11. else:
  12.     print(f'{name} bought a snack and has {budget - total:.2f} leva left.')
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement