Advertisement
Guest User

Untitled

a guest
Jul 18th, 2020
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  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":
  14. packet_type = "withEquipment"
  15. price = 100
  16. if vip_discount == "yes":
  17. price -= price * 0.10
  18. elif name_city == "Borovets":
  19. packet_type = "noEquipment"
  20. price = 80
  21. if vip_discount == "yes":
  22. price -= price * 0.05
  23.  
  24. elif name_city == "Varna":
  25. packet_type = "withBreakfast"
  26. price = 130
  27. if vip_discount == "yes":
  28. price -= price * 0.12
  29. elif name_city == "Burgas":
  30. packet_type = "noBreakfast"
  31. price = 100
  32. if vip_discount == "yes":
  33. price -= price * 0.07
  34. else:
  35. is_data_valid = False
  36.  
  37. sum_all = price * count_days
  38.  
  39. if count_days > 7:
  40. sum_all = (price * count_days) - (1 * price)
  41.  
  42. if count_days <= 0:
  43. print("Days must be positive number!")
  44. elif not is_data_valid:
  45. print("Invalid input!")
  46. else:
  47. print(f"The price is {sum_all:.2f}lv! Have a nice time!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement