Sichanov

fishing boat

Sep 9th, 2021 (edited)
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. budget = int(input())
  2. season = input()
  3. amount_of_fishermen = int(input())
  4. rent_price = 0
  5.  
  6. if season == 'Spring':
  7.     rent_price = 3000
  8.  
  9. elif season == 'Summer' or season == 'Autumn':
  10.     rent_price = 4200
  11.  
  12. elif season == 'Winter':
  13.     rent_price = 2600
  14.  
  15. if amount_of_fishermen <= 6:
  16.     rent_price -= rent_price * 0.1
  17. elif 7 <= amount_of_fishermen <= 11:
  18.     rent_price -= rent_price * 0.15
  19. elif 12 <= amount_of_fishermen:
  20.     rent_price -= rent_price * 0.25
  21.  
  22. if amount_of_fishermen % 2 == 0 and season != 'Autumn':
  23.     rent_price *= 0.95
  24.  
  25. leftover_money = rent_price - budget
  26.  
  27. if budget < rent_price:
  28.     print(f'Not enough money! You need {abs(leftover_money):.2f} leva.')
  29.  
  30. else:
  31.     print(f'Yes! You have {abs(leftover_money):.2f} leva left.')
  32.  
Add Comment
Please, Sign In to add comment