Advertisement
aneliabogeva

09. Wardrobe

Jul 5th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. colors = {}
  2.  
  3. for each_time in range((int(input()))):
  4. command = [item for item in input().split(" -> ")]
  5. values = [item for item in command[1].split(",")]
  6.  
  7. for value in values:
  8. if command[0] not in colors:
  9. colors[command[0]] = {}
  10. colors[command[0]][value] = 1
  11. elif command[0] in colors:
  12. if value not in colors[command[0]]:
  13. colors[command[0]][value] = 1
  14. elif value in colors[command[0]]:
  15. colors[command[0]][value] += 1
  16.  
  17. command_check = [item for item in input().split(" ")]
  18.  
  19. for color, item in colors.items():
  20. print(f"{color} clothes:")
  21. for values, count in item.items():
  22. if command_check[0] == color and command_check[1] == values:
  23. print(f"* {values} - {count} (found!)")
  24. else:
  25. print(f"* {values} - {count}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement