What is the most efficient way to test for False in a list?

Simon Forman sajmikins at gmail.com
Sun Jul 8 23:21:31 EDT 2007


On Jul 8, 7:43 pm, lex <alexander.so... at gmail.com> wrote:
> Of course there is the always the iteration method:
>
> list = [1, True, True, False, False, True]
> status = True
> for each in list:
>     status = status and each
>
> but what is your best way to test for for False in a list?


False in list





i.e. for a list N

if False in N:
    # do something with N..




More information about the Python-list mailing list