Guest User

Hello, France

a guest
Jan 19th, 2025
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 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.     elif budget < item_price:
  20.         total_sales += budget
  21.         break
  22.     else:
  23.         continue
  24.  
  25.     profit += (item_price * 0.40)
  26.     item_price = item_price * 1.40
  27.     total_sales += item_price
  28.     items_raised.append(str(round(item_price, 2)))
  29.  
  30.  
  31. print(' '.join(items_raised))
  32.  
  33. print(f'Profit: {profit :.2f}')
  34.  
  35. if total_sales >= 150.00:
  36.     print('Hello, France!')
  37. else:
  38.     print('Not enough money.')
Advertisement
Add Comment
Please, Sign In to add comment