Skip to content

Commit e6b919a

Browse files
committed
Reduce
1 parent 298f254 commit e6b919a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ sorted_by_second = sorted(<list>, key=lambda el: el[1])
3939
sorted_by_both = sorted(<list>, key=lambda el: (el[1], el[0]))
4040
flattened_list = list(itertools.chain.from_iterable(<list>))
4141
list_of_chars = list(<str>)
42-
product_of_elems = functools.reduce(lambda out, x: out * x, <list>)
42+
product_of_elems = functools.reduce(lambda agr, x: agr * x, <list>)
4343
no_duplicates = list(dict.fromkeys(<list>))
4444
```
4545

@@ -479,9 +479,9 @@ for i in range(10):
479479
### Map, Filter, Reduce
480480
```python
481481
from functools import reduce
482-
<iter> = map(lambda x: x + 1, range(10)) # (1, 2, ..., 10)
483-
<iter> = filter(lambda x: x > 5, range(10)) # (6, 7, ..., 9)
484-
<any_type> = reduce(lambda sum, x: sum+x, range(10)) # 45
482+
<iter> = map(lambda x: x + 1, range(10)) # (1, 2, ..., 10)
483+
<iter> = filter(lambda x: x > 5, range(10)) # (6, 7, ..., 9)
484+
<any_type> = reduce(lambda agr, x: agr + x, range(10)) # 45
485485
```
486486

487487
### Any, All

0 commit comments

Comments
 (0)