Advertisement
simeonshopov

Honeymoon

Nov 2nd, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.10 KB | None | 0 0
  1. budget = float(input())
  2. town = input()
  3. nights = int(input())
  4. total_price = 0
  5.  
  6. if town == "Cairo":
  7.     if 1 <= nights <= 4:
  8.         total_price = ((nights * 2 * 250) + 600) * 0.97
  9.     elif 5 <= nights <= 9:
  10.         total_price = ((nights * 2 * 250) + 600) * 0.95
  11.     elif 10 <= nights <= 24:
  12.         total_price = ((nights * 2 * 250) + 600) * 0.90
  13.     elif 25 <= nights <= 49:
  14.         total_price = ((nights * 2 * 250) + 600) * 0.83
  15.     elif nights >= 50:
  16.         total_price = ((nights * 2 * 250) + 600) * 0.70
  17. elif town == "Paris":
  18.     if 5 <= nights <= 9:
  19.         total_price = ((nights * 2 * 150) + 350) * 0.93
  20.     elif 10 <= nights <= 24:
  21.         total_price = ((nights * 2 * 150) + 350) * 0.88
  22.     elif 25 <= nights <= 49:
  23.         total_price = ((nights * 2 * 150) + 350) * 0.78
  24.     elif nights >= 50:
  25.         total_price = ((nights * 2 * 150) + 350) * 0.70
  26.     else:
  27.         total_price = nights * 2 * 150 + 350
  28. elif town == "Lima":
  29.     if 25 <= nights <= 49:
  30.         total_price = ((nights * 2 * 400) + 850) * 0.81
  31.     elif nights >= 50:
  32.         total_price = ((nights * 2 * 400) + 850) * 0.70
  33.     else:
  34.         total_price = nights * 2 * 400 + 850
  35. elif town == "New York":
  36.     if 1 <= nights <= 4:
  37.         total_price = ((nights * 2 * 300) + 650) * 0.97
  38.     elif 5 <= nights <= 9:
  39.         total_price = ((nights * 2 * 300) + 650) * 0.95
  40.     elif 10 <= nights <= 24:
  41.         total_price = ((nights * 2 * 300) + 650) * 0.88
  42.     elif 25 <= nights <= 49:
  43.         total_price = ((nights * 2 * 300) + 650) * 0.81
  44.     elif nights >= 50:
  45.         total_price = ((nights * 2 * 300) + 650) * 0.70
  46. elif town == "Tokyo":
  47.     if 10 <= nights <= 24:
  48.         total_price = ((nights * 2 * 350) + 700) * 0.88
  49.     elif 25 <= nights <= 49:
  50.         total_price = ((nights * 2 * 350) + 700) * 0.83
  51.     elif nights >= 50:
  52.         total_price = ((nights * 2 * 350) + 700) * 0.70
  53.     else:
  54.         total_price = nights * 2 * 350 + 700
  55.  
  56. if total_price <= budget:
  57.     print(f"Yes! You have {(budget - total_price):.2f} leva left.")
  58. else:
  59.     print(f"Not enough money! You need {(total_price - budget):.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement