I try to find common list of values for three different lists:
a = [1,2,3,4] b = [2,3,4,5] c = [3,4,5,6]
of course naturally I try to use t
out = [x for x in a if x in b and x in c]
is a quick and simple solution. This constructs a list out with entries from a, if those entries are in b and c.
out
a
b
c
For larger lists, you want to look at the answer provided by @poke