Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- train_ticket = 150
- items_dict = {"Clothes": 50.00, "Shoes": 35.00, "Accessories": 20.50}
- items_list = list(input().split("|"))
- budget = float(input())
- sales_list = []
- for item in range(len(items_list)):
- product = items_list[item]
- product_name = product.partition("-")[0]
- product_price = float(product.partition(">")[2])
- if budget >= product_price:
- if product_name in items_dict.keys():
- if product_price <= items_dict[product_name]:
- sales_list.append(f'{product_price * 1.4:.2f}')
- budget -= product_price
- print(*sales_list, sep=' ')
- print(f"Profit: {sum(list(map(float, sales_list))) - sum(list(map(float, sales_list))) / 1.4:.2f}")
- if (sum(list(map(float, sales_list))) + budget) > train_ticket:
- print("Hello, France!")
- else:
- print("Not enough money.")
Advertisement
Add Comment
Please, Sign In to add comment