Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.29 KB | None | 0 0
  1. budget = int(input())
  2. season = input()
  3. q_fishersman = int(input())
  4.  
  5.  
  6. if season == "Spring":
  7.     price = 3000
  8.     if q_fishersman <= 6:
  9.         price = 3000 * 0.9
  10.     elif 7 <= q_fishersman <= 11:
  11.         price = 3000 * 0.85
  12.     elif q_fishersman >= 12:
  13.         price = 3000 * 0.75
  14.         if q_fishersman % 2 == 0:
  15.             price = price * 0.95
  16.  
  17. elif season == "Summer":
  18.     price = 4200
  19.     if q_fishersman <= 6:
  20.         price = 4200 * 0.9
  21.     elif 7 <= q_fishersman <= 11:
  22.         price = 4200 * 0.85
  23.     elif q_fishersman >= 12:
  24.         price = 4200 * 0.75
  25.         if q_fishersman % 2 == 0:
  26.             price = price * 0.95
  27.  
  28. elif season == "Autumn":
  29.     if q_fishersman <= 6:
  30.         price = 4200 * 0.9
  31.     elif 7 <= q_fishersman <= 11:
  32.         price = 4200 * 0.85
  33.     elif q_fishersman >= 12:
  34.         price = 4200 * 0.75
  35.  
  36. elif season == "Winter":
  37.     if q_fishersman <= 6:
  38.         price = 2600 * 0.9
  39.     elif 7 <= q_fishersman <= 11:
  40.         price = 2600 * 0.85
  41.     elif q_fishersman >= 12:
  42.         price = 2600 * 0.75
  43.         if q_fishersman % 2 == 0:
  44.             price = price * 0.95
  45.  
  46. total = budget - price
  47.  
  48. if total >= 0:
  49.     print(f"Yes! You have {total:.2f} leva left.")
  50.  
  51. else:
  52.     total = abs(total)
  53.     print(f"Not enough money! You need {total:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement