mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-22 02:54:25 +01:00
parent
70c03e9801
commit
f0bd1cb481
4
README.md
vendored
4
README.md
vendored
@ -1273,8 +1273,8 @@ Why's this True-False alteration?
|
|||||||
```
|
```
|
||||||
|
|
||||||
- `all([])` returns `True` since the iterable is empty.
|
- `all([])` returns `True` since the iterable is empty.
|
||||||
- `all([[]])` returns `False` because `not []` is `True` is equivalent to `not False` as the list inside the iterable is empty.
|
- `all([[]])` returns `False` because the passed array has one element, `[]`, and in python, an empty list is falsy.
|
||||||
- `all([[[]]])` and higher recursive variants are always `True` since `not [[]]`, `not [[[]]]`, and so on are equivalent to `not True`.
|
- `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.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user