andonyan

Untitled

Feb 6th, 2020
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. input_string = input().split('|')
  2.  
  3. for index, string in enumerate(input_string):
  4. new_string = string.split('->')
  5. input_string[index] = new_string
  6.  
  7. budget = int(input())
  8. profit = 0
  9. bought_items = []
  10.  
  11. for item, price in input_string:
  12. if item == 'Clothes' and float(price) <= 50 and budget >= float(price):
  13. budget -= float(price)
  14. profit += ((float(price) * 1.4) - float(price))
  15. bought_items.append(round(float(price) * 1.4, 2))
  16. elif item == 'Shoes' and float(price) <= 35 and budget >= float(price):
  17. budget -= float(price)
  18. profit += (float(price) * 1.4 - float(price))
  19. bought_items.append(round(float(price) * 1.4, 2))
  20. elif item == 'Accessories' and float(price) <= 20.5 and budget >= float(price):
  21. budget -= float(price)
  22. profit += (float(price) * 1.4 - float(price))
  23. bought_items.append(round(float(price) * 1.4, 2))
  24.  
  25.  
  26. print(*bought_items)
  27. print(f'Profit: {profit:.2f}')
  28. if budget + sum(bought_items) >= 150:
  29. print('Hello, France!')
  30. else:
  31. print('Time to go.')
Advertisement
Add Comment
Please, Sign In to add comment