Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- budget = float(input())
- town = input()
- nights = int(input())
- total_price = 0
- if town == "Cairo":
- if 1 <= nights <= 4:
- total_price = ((nights * 2 * 250) + 600) * 0.97
- elif 5 <= nights <= 9:
- total_price = ((nights * 2 * 250) + 600) * 0.95
- elif 10 <= nights <= 24:
- total_price = ((nights * 2 * 250) + 600) * 0.90
- elif 25 <= nights <= 49:
- total_price = ((nights * 2 * 250) + 600) * 0.83
- elif nights >= 50:
- total_price = ((nights * 2 * 250) + 600) * 0.70
- elif town == "Paris":
- if 5 <= nights <= 9:
- total_price = ((nights * 2 * 150) + 350) * 0.93
- elif 10 <= nights <= 24:
- total_price = ((nights * 2 * 150) + 350) * 0.88
- elif 25 <= nights <= 49:
- total_price = ((nights * 2 * 150) + 350) * 0.78
- elif nights >= 50:
- total_price = ((nights * 2 * 150) + 350) * 0.70
- else:
- total_price = nights * 2 * 150 + 350
- elif town == "Lima":
- if 25 <= nights <= 49:
- total_price = ((nights * 2 * 400) + 850) * 0.81
- elif nights >= 50:
- total_price = ((nights * 2 * 400) + 850) * 0.70
- else:
- total_price = nights * 2 * 400 + 850
- elif town == "New York":
- if 1 <= nights <= 4:
- total_price = ((nights * 2 * 300) + 650) * 0.97
- elif 5 <= nights <= 9:
- total_price = ((nights * 2 * 300) + 650) * 0.95
- elif 10 <= nights <= 24:
- total_price = ((nights * 2 * 300) + 650) * 0.88
- elif 25 <= nights <= 49:
- total_price = ((nights * 2 * 300) + 650) * 0.81
- elif nights >= 50:
- total_price = ((nights * 2 * 300) + 650) * 0.70
- elif town == "Tokyo":
- if 10 <= nights <= 24:
- total_price = ((nights * 2 * 350) + 700) * 0.88
- elif 25 <= nights <= 49:
- total_price = ((nights * 2 * 350) + 700) * 0.83
- elif nights >= 50:
- total_price = ((nights * 2 * 350) + 700) * 0.70
- else:
- total_price = nights * 2 * 350 + 700
- if total_price <= budget:
- print(f"Yes! You have {(budget - total_price):.2f} leva left.")
- else:
- print(f"Not enough money! You need {(total_price - budget):.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement