testing array of logicals

Simon Forman rogue_pedro at yahoo.com
Thu Jul 13 21:43:35 EDT 2006


John Henry wrote:
> Hi list,
>
> Is there a more elagant way of doing this?
>
> # logflags is an array of logicals
> test=True
> for x in logflags:
>    test = test and x
> print test
>
> --
> Thanks,

So many ways....  *drool*
How about:

False not in logflags


(Anybody gonna run all these through timeit?  ;P )




More information about the Python-list mailing list