Kris Armstrong Kris Armstrong - 1 month ago 7
Python Question

Python Compare value in list 1 with value in list 2

I have created two lists in python list1 and list2.

I want to start at the first element in list 1 and search for that element in list 2 if it exists print something, if it does not exist print something else

I'm not sure how to march through list 1 and search list2 for value. I know this will involve a for loop.

for in list1

if values =
print("True")
else:
print("False)

Answer
for item in list1:
    if item in list2:
        print 'yes'
    else:
        print 'no'