I\'m trying to construct a one liner that would check if any of the values in one list are present in another list and return True or False if it does or does not.
T
You could also do
set(list1).intersection(list2)
to get the set of elements that occur in both; the length of the set is 0 if there's no intersection, otherwise positive. You can treat this set as a boolean, since Python evaluates empty sets to False and nonempty sets to True.
if set(list1).intersection(list2):
print ('Lists have elements in common')
else:
print ('No elements in common')
Runtime is O(n) average-case, O(n^2) worst-case: https://wiki.python.org/moin/TimeComplexity