Advertisement
exDotaPro

2019_6_july_2_family_trip

Feb 1st, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. budget = float(input())
  2. nights_count = int(input())
  3. night_price = float(input())
  4. extra_expenses_percentage = int(input())
  5.  
  6. if nights_count > 7:
  7.     night_price *= 0.95
  8.  
  9. all_nights_price = night_price * nights_count
  10. extra_expenses = budget * (extra_expenses_percentage * 1 / 100)
  11. total_money = all_nights_price + extra_expenses
  12.  
  13. diff = abs(budget - total_money)
  14.  
  15. if budget >= total_money:
  16.     print(f'Ivanovi will be left with {diff:.2f} leva after vacation.')
  17. else:
  18.     print(f'{diff:.2f} leva needed.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement