timeit('bool(set(a) & set(b))', setup=
    'a=list(range(1000));b=list(range(1000))', number=100000)
timeit('any(i in a for i in b)', setup=
    'a=list(range(1000));b=list(range(1000))', number=100000)
Test if lists share any items in python