|
@ -581,7 +581,7 @@ for i in range(10): |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
### Map, Filter, Reduce |
|
|
### Map, Filter, Reduce |
|
|
```python3 |
|
|
|
|
|
|
|
|
```python |
|
|
from functools import reduce |
|
|
from functools import reduce |
|
|
<iter> = map(lambda x: x + 1, range(10)) # (1, 2, ..., 10) |
|
|
<iter> = map(lambda x: x + 1, range(10)) # (1, 2, ..., 10) |
|
|
<iter> = filter(lambda x: x > 5, range(10)) # (6, 7, 8, 9) |
|
|
<iter> = filter(lambda x: x > 5, range(10)) # (6, 7, 8, 9) |
|
|