From 9b6cec690fa5741d53a5f0651d4cbc24511d1935 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 22 Sep 2019 15:36:06 +0300 Subject: [PATCH] Resolves #103 --- snippets/sum_by.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/sum_by.md b/snippets/sum_by.md index 90de69d0c..8456c414f 100644 --- a/snippets/sum_by.md +++ b/snippets/sum_by.md @@ -5,11 +5,11 @@ tags: math,list,function,beginner Returns the sum of a list, after mapping each element to a value using the provided function. -Use `map()` with `fn` to map each element to a value using the provided function, convert to a `list` and use `sum()` to return the sum of the values. +Use `map()` with `fn` to map each element to a value using the provided function, use `sum()` to return the sum of the values. ```py def sum_by(lst, fn): - return sum(list(map(fn,lst))) + return sum(map(fn,lst)) ``` ```py