L = [[5, 0, 6], [7, 22], [0, 4, 2], [9, 0, 45, 17]]
I do have this list and my task is to remove the 0's. I have to use both map() and filter() function.
The hint is that this task is solvable with a single expression using map, filter and lambda expressions.
I have been trying to figure this out for quite a while but I just don't get it. You don't have to solve it completely, but help would be appreciated.
I assume I use map() to iterate over the outer lists, but how do I call filter() with the sublist?
L2 = map(lambda x: filter(lambda x: x<>0 ,L),L)