Re: Python "member of" function
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Python "member of" function

From: Rene Pijlman <reply.in.the.newsgroup@my.address.is.invalid>
Date: Sat Apr 29 2006 - 12:41:22 CEST

brianlum@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
Received on Mon May 1 00:43:12 2006