Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- collection_of_items = input().split('|')
- budget = float(input())
- bought_items_new_prices = []
- profit = 0
- new_price_of_merge_sum = 0
- for item in collection_of_items:
- elements = item.split('->')
- type_of_merge = elements[0]
- price_of_merge = float(elements[1])
- if budget >= 150:
- break
- if budget < price_of_merge:
- continue
- if type_of_merge == 'Clothes' and price_of_merge <= budget:
- if price_of_merge > 50.00:
- continue
- if type_of_merge == 'Shoes' and price_of_merge <= budget:
- if price_of_merge > 35.00:
- continue
- if type_of_merge == 'Accessories' and price_of_merge <= budget:
- if price_of_merge > 20.50:
- continue
- budget -= price_of_merge
- profit += price_of_merge * 0.4
- new_price_of_merge = price_of_merge + (price_of_merge * 0.4)
- new_price_of_merge_sum += new_price_of_merge
- bought_items_new_prices.append(new_price_of_merge)
- for element in bought_items_new_prices:
- print(f'{element:.2f}', end=' ')
- print()
- print(f'Profit: {profit:.2f}')
- budget += new_price_of_merge_sum
- if budget >= 150:
- print("Hello, France!")
- else:
- print("Not enough money.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement