veronikaaa86

04. Fishing Boat

May 22nd, 2022 (edited)
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. budget = int(input())
  2. season = input()
  3. count_people = int(input())
  4.  
  5. price = 0
  6. if season == "Spring":
  7.     price = 3000
  8. elif season == "Summer" or season == "Autumn":
  9.     price = 4200
  10. elif season == "Winter":
  11.     price = 2600
  12.  
  13. if count_people <= 6:
  14.     price = price * 0.90
  15. elif 7 <= count_people <= 11:
  16.     price = price * 0.85
  17. else:
  18.     price = price * 0.75
  19.  
  20. if count_people % 2 == 0:
  21.     if 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.")
Add Comment
Please, Sign In to add comment