Advertisement
Spocoman

Easter Party

Feb 21st, 2022
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. guest = int(input())
  2. envelope = float(input())
  3. budget = float(input())
  4.  
  5. total_sum = guest * envelope
  6.  
  7. if 10 <= guest <= 15:
  8.     total_sum *= 0.85
  9. elif 15 < guest <= 20:
  10.     total_sum *= 0.8
  11. elif guest > 20:
  12.     total_sum *= 0.75
  13.  
  14. total_sum += budget / 10
  15.  
  16. if budget >= total_sum:
  17.     print(f"It is party time! {budget - total_sum:.2f} leva left.")
  18. else:
  19.     print(f"No party! {total_sum - budget:.2f} leva needed.")
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement