Advertisement
mark79

Fishing Boat

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