returning True, False or None
Mick Krippendorf
mad.mick at gmx.de
Fri Feb 4 13:28:11 EST 2005
Steven Bethard wrote:
> I have lists containing values that are all either True, False or
> None, e.g.:
>
> [True, None, None, False]
> [None, False, False, None ]
> [False, True, True, True ]
> etc.
>
> For a given list:
> * If all values are None, the function should return None.
> * If at least one value is True, the function should return True.
> * Otherwise, the function should return False.
Try:
>>> max(lst)
Mick.
More information about the Python-list
mailing list