Advertisement
exDotaPro

20_april_2019_2_easter_party

Jan 5th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. guests = int(input())
  2. couvert = float(input())
  3. budget = float(input())
  4.  
  5. cake_price = budget * 0.1
  6. couvert_price = guests * couvert
  7.  
  8. if guests > 20:
  9.     couvert_price *= 0.75
  10. elif 15 < guests <= 20:
  11.     couvert_price *= 0.80
  12. elif 10 <= guests <= 15:
  13.     couvert_price *= 0.85
  14.  
  15. total_sum = couvert_price + cake_price
  16. diff = budget - total_sum
  17.  
  18. if total_sum <= budget:
  19.     print(f'It is party time! {diff:.2f} leva left.')
  20. else:
  21.     print(f'No party! {abs(diff):.2f} leva needed.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement