From bf479ad66100f85ab267db1269c176e6e1c0c500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 28 Dec 2018 17:34:15 +0100 Subject: [PATCH] Reduce --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7dcdbec..a7ab96a 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ sorted_by_second = sorted(, key=lambda el: el[1]) sorted_by_both = sorted(, key=lambda el: (el[1], el[0])) flattened_list = list(itertools.chain.from_iterable()) list_of_chars = list() -product_of_elems = functools.reduce(lambda agr, x: agr * x, ) +product_of_elems = functools.reduce(lambda out, x: out * x, ) no_duplicates = list(dict.fromkeys()) ``` @@ -481,7 +481,7 @@ for i in range(10): from functools import reduce = map(lambda x: x + 1, range(10)) # (1, 2, ..., 10) = filter(lambda x: x > 5, range(10)) # (6, 7, ..., 9) - = reduce(lambda agr, x: agr + x, range(10)) # 45 + = reduce(lambda out, x: out + x, range(10)) # 45 ``` ### Any, All