Advertisement
HristoBaychev

zada`

Jan 21st, 2023
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. budjet = int(input())
  2. season = input()
  3. fishers = int(input())
  4.  
  5. spring_rent = 3000
  6. leten_rent = 4200
  7. winter = 2600
  8.  
  9. money = 0
  10.  
  11. if season == 'Summer' or 'Autumn':
  12.     money = leten_rent
  13.     if 0 <= fishers <= 6:
  14.         money *= 0.90
  15.     elif 7 <= fishers <= 11:
  16.         money *= 0.85
  17.     elif fishers >= 12:
  18.         money *= 0.75
  19.  
  20.  
  21. if season == 'Spring':
  22.     money = spring_rent
  23.     if 0 <= fishers <= 6:
  24.         money *= 0.90
  25.     elif 7 <= fishers <= 11:
  26.         money *= 0.85
  27.     elif fishers >= 12:
  28.         money *= 0.75
  29.  
  30.  
  31. if season == 'Winter':
  32.     money = winter
  33.     if 0 <= fishers <= 6:
  34.         money *= 0.90
  35.     elif 7 <= fishers <= 11:
  36.         money *= 0.85
  37.     elif fishers >= 12:
  38.         money *= 0.75
  39.  
  40. if season != 'Autumn' and fishers % 2 == 0:
  41.     money = money * 0.95
  42.  
  43. remain = abs(money - budjet)
  44.  
  45. if budjet >= money:
  46.     print(f'Yes! You have {remain:.2f} leva left.')
  47. else:
  48.     print(f'Not enough money! You need {remain:.2f} leva.')
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement