Advertisement
pacho_the_python

Untitled

Oct 1st, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.93 KB | None | 0 0
  1. town = input()
  2. package_type = input()
  3. vip = input()
  4. trip_days = int(input())
  5.  
  6. price = 0
  7.  
  8. if 1 <= trip_days <= 7:
  9.     if town == "Bansko" or town == "Borovets":
  10.         if package_type == "withEquipment":
  11.             price = trip_days * 100
  12.             if vip == "yes":
  13.                 price *= 0.9
  14.         elif package_type == "noEquipment":
  15.             price = trip_days * 80
  16.             if vip == "yes":
  17.                 price *= 0.95
  18.         else:
  19.             print("Invalid input!")
  20.     elif town == "Varna" or town == "Burgas":
  21.         if package_type == "withBreakfast":
  22.             price = trip_days * 130
  23.             if vip == "yes":
  24.                 price *= 0.88
  25.         elif package_type == "noBreakfast":
  26.             price = trip_days * 100
  27.             if vip == "yes":
  28.                 price *= 0.93
  29.         else:
  30.             print("Invalid input!")
  31. elif trip_days > 7:
  32.     if town == "Bansko" or town == "Borovets":
  33.         if package_type == "withEquipment":
  34.             price = (trip_days - 1) * 100
  35.             if vip == "yes":
  36.                 price *= 0.9
  37.         elif package_type == "noEquipment":
  38.             price = (trip_days - 1) * 80
  39.             if vip == "yes":
  40.                 price *= 0.95
  41.         else:
  42.             print("Invalid input")
  43.     if town == "Varna" or town == "Burgas":
  44.         if package_type == "withBreakfast":
  45.             price = (trip_days - 1) * 130
  46.             if vip == "yes":
  47.                 price *= 0.88
  48.         elif package_type == "noBreakfast":
  49.             price = (trip_days - 1) * 100
  50.             if vip == "yes":
  51.                 price *= 0.93
  52.         else:
  53.             print("Invalid input!")
  54.     else:
  55.         print("Invalid input!")
  56.  
  57. else:
  58.     print("Days must be positive number!")
  59.  
  60. if town == "Bansko" or town == "Borovets" or town == "Varna" or town == "Burgas":
  61.     print(f"The price is {price:.2f}lv! Have a nice time!")
  62. else:
  63.     print("Invalid input!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement