Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- item_list = input().split('|')
- budget = float(input())
- is_money = True
- items_raised = []
- profit = 0
- total_sales = 0
- for item in item_list:
- item_info = item.split('->')
- item_type = item_info[0]
- item_price = float(item_info[1])
- if item_type == 'Clothes' and item_price <= 50 and budget >= item_price:
- budget -= item_price
- elif item_type == 'Shoes' and item_price <= 35 and budget >= item_price:
- budget -= item_price
- elif item_type == 'Accessories' and item_price <= 20.50 and budget >= item_price:
- budget -= item_price
- elif budget < item_price:
- total_sales += budget
- break
- else:
- continue
- profit += (item_price * 0.40)
- item_price = item_price * 1.40
- total_sales += item_price
- items_raised.append(str(round(item_price, 2)))
- print(' '.join(items_raised))
- print(f'Profit: {profit :.2f}')
- if total_sales >= 150.00:
- print('Hello, France!')
- else:
- print('Not enough money.')
Advertisement
Add Comment
Please, Sign In to add comment