internal

Why does python `any` return a bool instead of the value?

Why does python `any` return a bool instead of the value? Question: and and or return the last element they evaluated, but why doesn’t Python’s built-in function any? I mean it’s pretty easy to implement oneself like this, but I’m still left wondering why. def any(l): for x in l: if x: return x return …

Total answers: 7