veronikaaa86

04. Fishing Boat

Mar 13th, 2022
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 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 <= 11:
  16. price_boat = price_boat * 0.85
  17. elif count_people > 11:
  18. price_boat = price_boat * 0.75
  19.  
  20.  
  21. if count_people % 2 == 0:
  22. if season != "Autumn":
  23. price_boat = price_boat * 0.95
  24.  
  25. diff = abs(budget - price_boat)
  26. if budget >= price_boat:
  27. print(f"Yes! You have {diff:.2f} leva left.")
  28. else:
  29. print(f"Not enough money! You need {diff:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment