On Mon, 14 Sep 2009 18:33:17 -0700 (PDT) André
<andre.robe...@gmail.com> wrote:

> Here's an example using sets:
> 
> >>> def is_present(list_1, list_2):
> ...    if set(list_1).intersection(set(list_2)):
> ...       return True
> ...    return False
> ...

Not that it matters, but I'd probably write:

def is_present(test, match):
    return bool(set(test) & set(match))

/W

-- 
INVALID? DE!

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to