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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!