Advertisement
Guest User

Fishing Boat

a guest
Nov 22nd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. budget_vac = int(input())
  2. season = input()
  3. N_fisherman = int(input())
  4. boat_price = 0
  5. # 2. Check season data and define boat price
  6. if season == "Spring":
  7.     boat_price = 3000
  8. elif season == "Summer" or season == "Autumn":
  9.     boat_price = 4200
  10. # elif season in ['Summer', 'Autumn']
  11. elif season =="Winter":
  12.     boat_price = 2600
  13. discount = 0
  14. if N_fisherman<=6:
  15.     discount=0.1
  16. elif 7<= N_fisherman<=11:
  17.     discount = 0.15
  18. else:
  19.     discount =0.25
  20. discount_value = boat_price*discount
  21. expenses = boat_price - discount_value
  22. if N_fisherman % 2 == 0 and season != "Autumn":
  23.     expenses = expenses- expenses*0.05
  24. if budget_vac>=expenses:
  25.     print(f"Yes! You have {(budget_vac-expenses):.2f} leva left.")
  26. else:
  27.     print(f"Not enough money! You need {(expenses-budget_vac):.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement