Question: Using python, how to remove duplicate numbers from sublist while maintaining sublist structure. I have list L1 containing, in this case, the duplicates of 16,
Using python, how to remove duplicate numbers from sublist while maintaining sublist structure. I have list L1 containing, in this case, the duplicates of 16, 22, 1 and 3, all in which I want to remove all repeats after the first instance and output the new, filtered list as list L2
L1 = [[16, 22, 23], [1, 5, 10, 16], [22, 1, 3], [3, 9, 14, 19]]
Desired output as list L2 of:
L2 = [[16, 22, 23], [1, 5, 10], [3], [9, 14, 19]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
