Em Sáb, 2006-04-01 às 20:44 +1000, Steven D'Aprano escreveu:
> Here's another way of doing it:
> 
> lst = [2, 4, 42]
> any(map(lambda x: x==42, lst))

In fact, as we're talking about Python 2.5 anyway, it would be better
not to waste memory and use:

any(x == 42 for x in lst)

-- 
Felipe.

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

Reply via email to