-3

My understanding of all() is that it returns True if every value if an iterable is True when evaluated as a boolean.

bool([]) == False, so why does all([]) return True?

Alec
  • 8,529
  • 8
  • 37
  • 63

1 Answers1

1

It's vacuously true. Since there's nothing in the list, there's no false elements in the list, and all only returns False if at least one of its inputs is False. Since all zero elements in the list are true, all returns True.