Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- town = input()
- pack = input()
- vip = input()
- days = int(input())
- if days > 7:
- days -= 1
- total = days
- if (town in ("Bansko", "Borovets", "Varna", "Burgas") and
- pack in ("noEquipment", "withEquipment", "noBreakfast", "withBreakfast")):
- if days < 1:
- print("Days must be positive number!")
- else:
- if town in ("Bansko", "Borovets"):
- if pack == "withEquipment":
- total *= 100
- if vip == "yes":
- total *= 0.90
- else:
- total *= 80
- if vip == "yes":
- total *= 0.95
- else:
- if pack == "withBreakfast":
- total *= 130
- if vip == "yes":
- total *= 0.88
- else:
- total *= 100
- if vip == "yes":
- total *= 0.93
- print(f"The price is {total:.2f}lv! Have a nice time!")
- else:
- print("Invalid input!")
- РЕШЕНИЕ С ТЕРНАРЕН ОПЕРАТОР:
- town = input()
- pack = input()
- vip = input()
- days = int(input())
- if days > 7:
- days -= 1
- total = days
- if (town in ("Bansko", "Borovets", "Varna", "Burgas") and
- pack in ("noEquipment", "withEquipment", "noBreakfast", "withBreakfast")):
- if days < 1:
- print("Days must be positive number!")
- else:
- if town in ("Bansko", "Borovets"):
- total *= 100 * (0.90 if vip == "yes" else 1) if pack == "withEquipment" else 80 * (0.95 if vip == "yes" else 1)
- else:
- total *= 130 * (0.88 if vip == "yes" else 1) if pack == "withBreakfast" else 100 * (0.93 if vip == "yes" else 1)
- print(f"The price is {total:.2f}lv! Have a nice time!")
- else:
- print("Invalid input!")
Add Comment
Please, Sign In to add comment