Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- train_ticket = 150.0
- items_to_buy = input()
- budget = float(input())
- current_budget = budget
- items_to_buy = items_to_buy.split("|")
- current_item = []
- profit = 0.0
- prices_to_print = ''
- for ind in range(len(items_to_buy)):
- current_item = items_to_buy[ind].split('->')
- item_price = float(current_item[1])
- if current_item[0] == "Clothes" and item_price <= 50.00:
- if current_budget >= item_price:
- current_budget -= item_price
- profit += item_price * 0.40
- prices_to_print += f'{item_price * 1.4:.2f} '
- if current_item[0] == "Shoes" and item_price <= 35.00:
- if current_budget >= item_price:
- current_budget -= item_price
- profit += item_price * 0.40
- prices_to_print += f'{item_price * 1.4:.2f} '
- if current_item[0] == "Accessories" and item_price <= 20.50:
- if current_budget >= item_price:
- current_budget -= item_price
- profit += item_price * 0.40
- prices_to_print += f'{item_price * 1.4:.2f} '
- print(prices_to_print.strip())
- print(f"Profit: {profit:.2f}")
- if budget + profit >= train_ticket:
- print("Hello, France!")
- else:
- print("Not enough money.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement