Advertisement
Darlexbg

fishing boat

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