Advertisement
veronikaaa86

04. Fishing Boat

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