Is there such an idiom?

Per mailper at
Mon Mar 20 02:21:22 CET 2006

Thanks Ron,
 surely set is the simplest way to understand the question, to see
whether there is a non-empty intersection. But I did the following
thing in a silly way, still not sure whether it is going to be linear
def foo():
    l = [...]
    s = [...]
    dic = {}
    for i in l:
        dic[i] = 0
    while k <len(s):
        if s[k] in dic:
            return True
        else: pass
    if k == len(s):
        return False

I am still a rookie, and partly just migrated from Haskell...
I am not clear about how making one of the lists a dictionary is

More information about the Python-list mailing list