Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def increase_price(n):
- result = n * 1.4
- return result
- item_list = input().split("|")
- budget = float(input())
- enough_budget = False
- new_price = 0
- list_of_prices = []
- for item in item_list:
- valid_item = False
- current_list = item.split("->")
- current_item, price = current_list[0], float(current_list[1])
- if price <= budget:
- if current_item == "Clothes" and price <= 50.00:
- valid_item = True
- elif current_item == "Shoes" and price <= 35.00:
- valid_item = True
- elif current_item == "Accessories" and price <= 20.50:
- valid_item = True
- if valid_item:
- list_of_prices.append(price)
- budget -= price
- increased_list = list(map(increase_price, list_of_prices))
- profit = sum(increased_list) - sum(list_of_prices)
- if budget + sum(increased_list) >= 150:
- enough_budget = True
- print(" ".join(map(lambda x: f'{x:.2f}', increased_list)))
- print(f"Profit: {profit:.2f}")
- if enough_budget:
- print("Hello, France!")
- else:
- print("Not enough money.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement