BbJLeB

05. Fishing Boat

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