Sichanov

ss

Jan 31st, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. budget = int(input())
  2. season = input()
  3. group = int(input())
  4. boat = 0
  5. bonus_discount = 0
  6. if season == "Spring":
  7.     boat = 3000
  8.     if group <= 6:
  9.         boat *= 0.9
  10.     elif 6 < group <= 11:
  11.         boat *= 0.85
  12.     else:
  13.         boat *= 0.75
  14. elif season in ("Summer", "Autumn"):
  15.     boat = 4200
  16.     if group <= 6:
  17.         boat *= 0.9
  18.     elif 6 < group <= 11:
  19.         boat *= 0.85
  20.     else:
  21.         boat *= 0.75
  22. elif season == "Winter":
  23.     boat = 2600
  24.     if group <= 6:
  25.         boat *= 0.9
  26.     elif 6 < group <= 11:
  27.         boat *= 0.85
  28.     else:
  29.         boat *= 0.75
  30. if group % 2 == 0 and not season == "Autumn":
  31.     boat *= 0.95
  32.  
  33. difference = abs(budget - boat)
  34. if budget >= boat:
  35.     print(f"Yes! You have {difference:.2f} leva left.")
  36. else:
  37.     print(f"Not enough money! You need {difference:.2f} leva.")
  38.  
Advertisement
Add Comment
Please, Sign In to add comment