Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list_items = input().split("|")
- budget = float(input())
- new_price = 0
- profit = 0
- sum_sold_items = 0
- list_element = []
- for index in range(len(list_items)):
- list_element = list_items[index].split("->")
- if (float(list_element[1]) <= budget) and ((list_element[0] == "Clothes" and float(list_element[1]) <= 50) or
- (list_element[0] == "Shoes" and float(list_element[1]) <= 35) or
- (list_element[0] == "Accessories" and float(list_element[1]) <= 20.50)):
- new_price += 1.4 * float(list_element[1])
- profit += 0.4 * float(list_element[1])
- budget -= float(list_element[1])
- sum_sold_items += new_price
- print(f"{new_price:.2f}", end=" ")
- new_price = 0
- print(f"\nProfit: {profit:.2f}")
- if budget + sum_sold_items >= 150:
- print("Hello, France!")
- else:
- print("Not enough money.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement