svephoto

Fishing Boat [python]

Feb 28th, 2021 (edited)
225
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. budget = int(input())
  2. season = input()
  3. people = int(input())
  4.  
  5. ship_rent = 0
  6.  
  7. if season == 'Spring':
  8.     ship_rent = 3000
  9. if season == 'Summer' or season == 'Autumn':
  10.     ship_rent = 4200
  11. if season == 'Winter':
  12.     ship_rent = 2600
  13. if people <= 6:
  14.     ship_rent = ship_rent * 0.9
  15. elif 7 <= people <= 11:
  16.     ship_rent = ship_rent * 0.85
  17. elif people >= 12:
  18.     ship_rent = ship_rent * 0.75
  19. if people % 2 == 0 and season != 'Autumn':
  20.     ship_rent = ship_rent * 0.95
  21.  
  22. remaining_money = budget - ship_rent
  23. money_needed = abs(ship_rent - budget)
  24.  
  25. if budget >= ship_rent:
  26.     print(f'Yes! You have {remaining_money:.2f} leva left.')
  27. else:
  28.     print(f'Not enough money! You need {money_needed:.2f} leva.')
  29.  
RAW Paste Data