Advertisement
Guest User

Fishing_boat

a guest
Mar 6th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. #read data
  2. budget = int(input())
  3. season = input()
  4. fishermen = int(input())
  5. price = 0
  6. final_price = 0
  7.  
  8. discount1 = 0
  9. discount2 = 0
  10.  
  11. #conditions
  12.  
  13. if season == "Spring":
  14.     price = 3000
  15. elif season == "Summer":
  16.     price = 4200
  17. elif season == "Autumn":
  18.     price = 4200
  19. elif season == "Winter":
  20.     price = 2600
  21.  
  22. if 6 >= fishermen:
  23.     discount1 = 0.10
  24. elif 7 <= fishermen <= 11:
  25.     discount1 = 0.15
  26. elif fishermen >= 12:
  27.     discount1 = 0.25
  28.  
  29. if fishermen % 2 == 0 and not season == "Autumn":
  30.     discount2 = 0.05
  31.  
  32. #calculations
  33. final_price = price - (price * discount1) - (price * discount2)
  34. money_left = budget - final_price
  35. money_needed = final_price - budget
  36.  
  37. #print
  38.  
  39. if budget >= final_price:
  40.     print(f"Yes! You have {money_left:.2f} leva left.")
  41. else:
  42.     print(f"Not enough money! You need {money_needed:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement