Mmm, like that?
if list1 == list2: # compare lists for equality doStuff() # if lists are equal, do stuff after that
Of course, you need to clarify what you mean by "if matching list values." The above will check to see if both lists have the same elements in the same position - that is, if they are equal.
EDIT:
The question is not clear, let some possible interpretations. To check if all the items in list1 in list2 , follow these steps:
if all(x in list2 for x in list1): doStuff()
Or do something with each item in list1 , which also belongs to list2 , do the following:
for e in set(list1) & set(list2): doStuff(e)
Γscar LΓ³pez
source share