Skip to content

Commit 9f9d61f

Browse files
committed
Random
1 parent 7582867 commit 9f9d61f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ functools.reduce(lambda sum, x: sum+x, range(10)) # 45
466466
```
467467

468468
```python
469-
>>> [a if a else 2 for a in [0, 1, 0, 3]]
470-
[2, 1, 2, 3]
469+
>>> [a if a else 'zero' for a in (0, 1, 0, 3)]
470+
['zero', 1, 'zero', 3]
471471
```
472472

473473
### Namedtuple, Enum, Class
@@ -481,6 +481,7 @@ Cutlery = Enum('Cutlery', {'knife': 1, 'fork': 2, 'spoon': 3})
481481

482482
# Warrning: Objects will share the objects that are initialized in the dict!
483483
Creature = type('Creature', (), {'position': Point(0, 0), 'direction': Direction.n})
484+
creature = Creature()
484485
```
485486

486487

0 commit comments

Comments
 (0)