simeonshopov

Family vacation expenses

Sep 3rd, 2019
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. budget=float(input())
  2. nights=int(input())
  3. night_price=float(input())
  4. extra_expenses=int(input())
  5.  
  6. if nights>7:
  7.   night_price=night_price*0.95
  8. else:
  9.     night_price=night_price
  10.    
  11. left=night_price*nights+budget*extra_expenses/100
  12.  
  13. if left<=budget:
  14.   print('Ivanovi will be left with', '%.2f'%(budget-left), 'leva after vacation.')
  15. else:
  16.   print('%.2f'%-(budget-left), 'leva needed.')
Advertisement
Add Comment
Please, Sign In to add comment