I have a huge list of lists. I want to Merge all child lists to parent list and remove duplicates item from parent list after merge.
What is the optimized wa
Use set and chain:
x = [['a', 'b', 'c', 2, 4], ['x', 1, 2, 3, 'z'], ['z', 'b', 'y', 'a' 'x']] from itertools import chain result = list(set(chain.from_iterable(x))) print(result)