Advertisement
simeonshopov

Fishermen boat rent

Oct 1st, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. budget = int(input())
  2. season = input()
  3. fishermen = int(input())
  4. seasons = ["Spring", "Summer", "Autum", "Winter"]
  5. prices = [3000, 4200, 4200, 2600]
  6. index = seasons.index(season)
  7. rent = 0
  8.  
  9. if season in seasons:
  10.   rent = prices[index]
  11.   if fishermen <=6:
  12.     rent *=0.9
  13.   elif 7 <= fishermen <=11:
  14.     rent *= 0.85
  15.   elif fishermen >= 12:
  16.     rent *=0.75
  17.  
  18. if fishermen % 2 == 0 and season != "Autum":
  19.   rent *= 0.95
  20.  
  21. print(f"Yes! You have {(budget - rent):.2f} leva left" if budget >= rent else f"Not enough money! You need {(rent - budget):.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement