Advertisement
Guest User

03. Travel Agency

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