I know that the built-in all()
function returns true when all elements of the iterable are true. But when I create a tuple and give it 2 random integers as elements, it returns true. Why is that?
For example:
tup = 1234 , 5678
and call the all()
function on it:
print ( all(t) )
>>> True
I'm confused because I thought python could only return true or false when a boolean operation has been performed.
But I haven't performed a boolean operation, I only gave all()
2 integers. I didn't say for example 2>= 1
. So why does all()
return true for my tuple? Or is that just the default answer?