Advertisement
veronikaaa86

04. Fishing Boat

Jul 17th, 2022
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. budget = int(input())
  2. season = input()
  3. count_people = int(input())
  4.  
  5. price_boat = 0
  6. if season == "Spring":
  7. price_boat = 3000
  8. elif season == "Summer" or season == "Autumn":
  9. price_boat = 4200
  10. elif season == "Winter":
  11. price_boat = 2600
  12.  
  13. if count_people <= 6:
  14. price_boat = price_boat * 0.90
  15. elif count_people >= 7 and count_people <= 11:
  16. price_boat = price_boat * 0.85
  17. elif count_people >= 12:
  18. price_boat = price_boat * 0.75
  19.  
  20. if count_people % 2 == 0 and season != "Autumn":
  21. price_boat = price_boat * 0.95
  22.  
  23. # if count_people % 2 == 0:
  24. # if season != "Autumn":
  25. # price_boat = price_boat * 0.95
  26.  
  27. diff = abs(budget - price_boat)
  28. if budget >= price_boat:
  29. print(f"Yes! You have {diff:.2f} leva left.")
  30. else:
  31. print(f"Not enough money! You need {diff:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement