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

Paul Rubin http
Mon Jul 9 01:54:42 CEST 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