Guest User

Untitled

a guest
Apr 3rd, 2020
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. products = input().split("|")
  2. budget = float(input())
  3.  
  4. element = ''
  5. bought_products = []
  6. profit = []
  7. total_profit = 0
  8.  
  9. for item in products:
  10. element = item.split("->")
  11. wear = element[0]
  12. price = float(element[1])
  13. if budget - price >= 0:
  14.  
  15. if (wear == "Clothes" and price <= 50.0) \
  16. or (wear == "Shoes" and price <= 35.0) \
  17. or (wear == "Accessories" and price <= 20.50):
  18. bought_products.append(price)
  19. budget -= price
  20.  
  21. profitt = 0.4*(sum(bought_products))
  22. for i in range(len(bought_products)):
  23.  
  24. print(f"{(bought_products[i]*1.4):.2f}", end=' ')
  25. print()
  26. print(f'Profit: {profitt:.2f}')
  27.  
  28. total_profit = budget + sum(bought_products) * 1.4
  29.  
  30. if total_profit >= 150:
  31.  
  32. print(f"Hello, France!")
  33. else:
  34.  
  35. print("Time to go.")
Advertisement
Add Comment
Please, Sign In to add comment