SyntaxFix
Write A Post
Hire A Developer
Questions
c1 = [1, 6, 7, 10, 13, 28, 32, 41, 58, 63] c2 = [[13, 17, 18, 21, 32], [7, 11, 13, 14, 28], [1, 5, 6, 8, 15, 16]] c3 = [list(set(i) & set(c1)) for i in c2] c3 [[32, 13], [28, 13, 7], [1, 6]]
For me this is very elegant and quick way to to it :)