Advertisement
veronikaaa86

04. Fishing Boat

Sep 25th, 2022
1,174
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 1 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 > 6 and count_people <= 11:
  16.     price_boat = price_boat * 0.85
  17. elif count_people > 11:
  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. diff = abs(price_boat - budget)
  24. if budget >= price_boat:
  25.     print(f"Yes! You have {diff:.2f} leva left.")
  26. else:
  27.     print(f"Not enough money! You need {diff:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement