Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/python3.7
- # -*- coding: utf-8 -*import
- items = input().split('|')
- budget = float(input())
- money = budget
- bought = []
- profit = 0
- for item in items:
- new_price = 0
- price = float(item[item.index('>') + 1:])
- if ('Clothes' in item and price <= 50) or ('Shoes' in item and price <= 35) or\
- ('Accessories' in item and price <= 20.50):
- if budget >= price:
- budget -= price
- new_price = price * 1.4
- bought.append(f'{new_price:.2f}')
- profit += (new_price - price)
- money += profit
- print(*bought)
- print(f'Profit: {profit:.2f}')
- if money >= 150:
- print('Hello, France!')
- else:
- print('Time to go.')
Advertisement
Add Comment
Please, Sign In to add comment