Advertisement
bl00dt3ars

03. Travel Agency

Nov 20th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.07 KB | None | 0 0
  1. city = input()
  2. packet_type = input()
  3. vip_discount = input()
  4. days = int(input())
  5. is_true = True
  6.  
  7. if days < 1:
  8.     is_true = False
  9.     print("Days must be positive number!")
  10.    
  11. elif days > 7:
  12.     days -= 1
  13.  
  14. if city == "Bansko" or city == "Borovets":
  15.     if packet_type == "noEquipment":
  16.         price = 80 * days
  17.         if vip_discount == "yes":
  18.             price *= 0.95
  19.     elif packet_type == "withEquipment":
  20.         price = 100 * days
  21.         if vip_discount == "yes":
  22.             price *= 0.9
  23.     else:
  24.         print("Invalid input!")
  25.         is_true = False
  26. elif city == "Varna" or city == "Burgas":
  27.     if packet_type == "noBreakfast":
  28.         price = 100 * days
  29.         if vip_discount == "yes":
  30.             price *= 0.93
  31.     elif packet_type == "withBreakfast":
  32.         price = 130 * days
  33.         if vip_discount == "yes":
  34.             price *= 0.88
  35.     else:
  36.         print("Invalid input!")
  37.         is_true = False
  38. else:
  39.     print("Invalid input!")
  40.     is_true = False
  41.  
  42. if is_true:
  43.     print(f"The price is {price:.2f}lv! Have a nice time!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement