how to compare each element in two lists in python code example
Example 1: compare lists element wise python
[ x&y for (x,y) in zip(list_a, list_b)]
Example 2: how to compare two lists element by element in python and return matched element
>>> [i for i, j in zip(a, b) if i == j]
[5]