Python "member of" function

Rene Pijlman reply.in.the.newsgroup at my.address.is.invalid
Sat Apr 29 06:41:22 EDT 2006


brianlum at gmail.com:
>I was wondering if anyone knew of a built in Python function that will
>check if an item is a member of a list, i.e., if item i is a member of
>list l.

>>> 1 in [1,3,4]
True
>>> 2 in [1,3,4]
False

-- 
René Pijlman



More information about the Python-list mailing list