Advertisement
pacho_the_python

Untitled

Sep 30th, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.85 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.     else:
  32.         print("Invalid input!")
  33. elif trip_days > 7:
  34.     if town == "Bansko" or town == "Borovets":
  35.         if package_type == "withEquipment":
  36.             price = (trip_days - 1) * 100
  37.             if vip == "yes":
  38.                 price *= 0.9
  39.         elif package_type == "noEquipment":
  40.             price = (trip_days - 1) * 80
  41.             if vip == "yes":
  42.                 price *= 0.95
  43.         else:
  44.             print("Invalid input")
  45.     if town == "Varna" or town == "Burgas":
  46.         if package_type == "withBreakfast":
  47.             price = (trip_days - 1) * 130
  48.             if vip == "yes":
  49.                 price *= 0.88
  50.         elif package_type == "noBreakfast":
  51.             price = (trip_days - 1) * 100
  52.             if vip == "yes":
  53.                 price *= 0.93
  54.         else:
  55.             print("Invalid input")
  56.     else:
  57.         print("Invalid input!")
  58.  
  59. else:
  60.     print("Days must be positive number!")
  61.  
  62. print(f"The price is {price:.2f}lv! Have a nice time!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement