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

Paul Rubin http
Sun Jul 8 19:54:42 EDT 2007


lex <alexander.somma at gmail.com> writes:
> 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?

status = all(list)



More information about the Python-list mailing list