For what iterable sequences, x
, does the expression
any(x) and not all(x)
evaluate to True
?
any(x) and not all(x)
is True
if at least one item in x
is equivalent to True
but not all of them:
>>> x1, x2, x3 = [False, False], [1, 2, 3, 4], [1, 2, 3, 0]
>>> any(x1) and not all(x1)
False
>>> any(x2) and not all(x2)
False
>>> any(x3) and not all(x3)
True