Advertisement
dkyoseff

Conditional Statements Advanced - Exercise / 04. Fishing Boat

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