```
>>> list1 = ['a','b','c']
>>> list2 = ['q','a','b']
>>> [x for x in list1 if any(x == y for y in list2)]
['a', 'b']
```

as @frol commented, there is a better solution:

`[x for x in list1 if x in list2]`

oomxcq

```
>>> list1 = ['a','b','c']
>>> list2 = ['q','a','b']
>>> [x for x in list1 if any(x == y for y in list2)]
['a', 'b']
```

as @frol commented, there is a better solution:

`[x for x in list1 if x in list2]`

WTF?! Use operator

`in`

instead...