Guest User

Untitled

a guest
Jan 19th, 2025
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. item_list = input().split('|')
  2. budget = float(input())
  3. is_money = True
  4. items_raised = []
  5. profit = 0
  6. total_sales = 0
  7.  
  8. for item in item_list:
  9.     item_info = item.split('->')
  10.     item_type = item_info[0]
  11.     item_price = float(item_info[1])
  12.  
  13.     if item_type == 'Clothes' and item_price <= 50 and budget >= item_price:
  14.         budget -= item_price
  15.     elif item_type == 'Shoes' and item_price <= 35 and budget >= item_price:
  16.         budget -= item_price
  17.     elif item_type == 'Accessories' and item_price <= 20.50 and budget >= item_price:
  18.         budget -= item_price
  19.     else:
  20.         continue
  21.  
  22.     profit += (item_price * 0.40)
  23.     item_price = item_price * 1.40
  24.     total_sales += item_price
  25.     items_raised.append(f'{item_price :.2f}')
  26.  
  27.  
  28. print(' '.join(items_raised))
  29.  
  30. print(f'Profit: {profit :.2f}')
  31.  
  32. if total_sales + budget >= 150.00:
  33.     print('Hello, France!')
  34. else:
  35.     print('Not enough money.')
Advertisement
Add Comment
Please, Sign In to add comment