i'm trying to filter a list, i want to extract from a list A (is a list of lists), the elements what matches they key index 0, with another list B what has a serie of values
like this
list_a = list(
list(1, ...),
list(5, ...),
list(8, ...),
list(14, ...)
)
list_b = list(5, 8)
return filter(lambda list_a: list_a[0] in list_b, list_a)
should return:
list(
list(5, ...),
list(8, ...)
)
How can i do this? Thanks!
[5,8]
instead oflist(5,8)
) - Kevin