Skip to content

Commit bf479ad

Browse files
committed
Reduce
1 parent e6b919a commit bf479ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 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 agr, x: agr * x, <list>)
42+
product_of_elems = functools.reduce(lambda out, x: out * x, <list>)
4343
no_duplicates = list(dict.fromkeys(<list>))
4444
```
4545

@@ -481,7 +481,7 @@ for i in range(10):
481481
from functools import reduce
482482
<iter> = map(lambda x: x + 1, range(10)) # (1, 2, ..., 10)
483483
<iter> = filter(lambda x: x > 5, range(10)) # (6, 7, ..., 9)
484-
<any_type> = reduce(lambda agr, x: agr + x, range(10)) # 45
484+
<any_type> = reduce(lambda out, x: out + x, range(10)) # 45
485485
```
486486

487487
### Any, All

0 commit comments

Comments
 (0)