GeorgiLukanov87

Hello_france

Jun 5th, 2022 (edited)
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. items = input().split("|")
  2. budget = int(input())
  3. start_budget = budget
  4. income = []
  5. profit = 0
  6. for item in items:
  7.     product, price = item.split('->')
  8.     price = float(price)
  9.     condition = False
  10.     if price > budget:
  11.         continue
  12.     if product == 'Clothes':
  13.         if not 0 <= price <= 50:
  14.             condition = True
  15.     elif product == 'Shoes':
  16.         if not 0 <= price <= 35:
  17.             condition = True
  18.     else:
  19.         if not 0 <= price <= 20.50:
  20.             condition = True
  21.     if not condition:
  22.         budget -= price
  23.         income.append(price + price * 0.40)
  24.         profit += price * 0.40
  25. for el in income:
  26.     print(f"{el:.2f}", end=' ')
  27. print()
  28. print(f"Profit: {profit:.2f}")
  29. if start_budget + profit >= 150:
  30.     print('Hello, France!')
  31. else:
  32.     print('Not enough money.')
Add Comment
Please, Sign In to add comment