Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- train_ticket_cost = 150
- maximum_prices = {
- "Clothes": 50.00,
- "Shoes": 35.00,
- "Accessories": 20.50
- }
- collection_items, budget = input().split("|"), float(input())
- old_budget = budget
- new_list = []
- sold_items = []
- for item_data in collection_items:
- item_type, item_price = item_data.split("->")
- item_price = float(item_price)
- if item_type in maximum_prices and item_price <= maximum_prices[item_type] and budget >= item_price:
- budget -= item_price
- sold_items.append(item_type)
- new_list.append((item_type, item_price))
- sold_item_prices = [item[1] * 1.4 for item in new_list if item[0] in sold_items]
- profit = sum(sold_item_prices) - sum(item[1] for item in new_list if item[0] in sold_items)
- new_dujet= old_budget + profit
- #print("new_dujet", new_dujet)
- print(" ".join([f"{price:.2f}" for price in sold_item_prices]))
- print(f"Profit: {profit:.2f}")
- if 150 <= new_dujet:
- print("Hello, France!")
- else:
- print("Not enough money.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement