Guest User

Untitled

a guest
Jul 19th, 2020
230
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # 1.Име на града -текст с възможности ("Bansko", "Borovets", "Varna"или "Burgas")
  2. # 2.Вид на пакета -текст с възможности ("noEquipment", "withEquipment", "noBreakfast"или "withBreakfast")
  3. # 3.Притежание на VIP отстъпка -текст с възможности "yes"или "no"
  4. # 4.Дни за престой -цяло число в интервала [1 ... 10000]
  5.  
  6. name_city = input()
  7. packet_type = input()
  8. vip_discount = input()
  9. count_days = int(input())
  10. price = 0
  11. is_data_valid = True
  12.  
  13. if name_city == "Bansko" or name_city == "Borovets":
  14. if packet_type == "withEquipment":
  15. price = 100
  16. if vip_discount == "yes":
  17. price -= price * 0.10
  18. elif packet_type == "noEquipment":
  19. price = 80
  20. if vip_discount == "yes":
  21. price -= price * 0.05
  22. else:
  23. is_data_valid = False
  24.  
  25. elif name_city == "Varna" or name_city == "Burgas":
  26. if packet_type == "withBreakfast":
  27. price = 130
  28. if vip_discount == "yes":
  29. price -= price * 0.12
  30. elif packet_type == "noBreakfast":
  31. price = 100
  32. if vip_discount == "yes":
  33. price -= price * 0.07
  34. else:
  35. is_data_valid = False
  36. else:
  37. is_data_valid = False
  38.  
  39. sum_all = price * count_days
  40.  
  41. if count_days >= 7:
  42. sum_all = (price * count_days) - (1 * count_days)
  43.  
  44. if count_days < 1:
  45. print("Days must be positive number!")
  46. elif not is_data_valid:
  47. print("Invalid input!")
  48. else:
  49. print(f"The price is {sum_all:.2f}lv! Have a nice time!")
RAW Paste Data