Oct-06-2016, 06:50 PM
I am trying to find a way of testing whether or not at least one element from a list #1 is present in a list #2
One thing I've found is this thread: http://stackoverflow.com/questions/74028...-in-a-list though I dont' really understand the first(accepted) answer. If someone could break that answer down or suggest an alternative way of doing it, that would be a big help.
It would look like:
mylist = [1,2,3,4]
mylist2 = [4,5,6]
if (any(mylist) in mylist2):
One thing I've found is this thread: http://stackoverflow.com/questions/74028...-in-a-list though I dont' really understand the first(accepted) answer. If someone could break that answer down or suggest an alternative way of doing it, that would be a big help.
It would look like:
mylist = [1,2,3,4]
mylist2 = [4,5,6]
if (any(mylist) in mylist2):