Skip to content

Commit d6ba3a6

Browse files
authored
Merge pull request satwikkansal#256 from chrismilson/all-true-ation-readability
Update explanation for All-true-ation
2 parents 70c03e9 + f0bd1cb commit d6ba3a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1273,8 +1273,8 @@ Why's this True-False alteration?
12731273
```
12741274
12751275
- `all([])` returns `True` since the iterable is empty.
1276-
- `all([[]])` returns `False` because `not []` is `True` is equivalent to `not False` as the list inside the iterable is empty.
1277-
- `all([[[]]])` and higher recursive variants are always `True` since `not [[]]`, `not [[[]]]`, and so on are equivalent to `not True`.
1276+
- `all([[]])` returns `False` because the passed array has one element, `[]`, and in python, an empty list is falsy.
1277+
- `all([[[]]])` and higher recursive variants are always `True`. This is because the passed array's single element (`[[...]]`) is no longer empty, and lists with values are truthy.
12781278
12791279
---
12801280

0 commit comments

Comments
 (0)