Advertisement
PowerCell46

Fishing boat Python

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