From 159cc26814efe653401e2ad0242c2086e97eb2e7 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 22 Sep 2019 15:35:10 +0300 Subject: [PATCH] Update max_by.md --- snippets/max_by.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/max_by.md b/snippets/max_by.md index dce10cb38..d611f8d13 100644 --- a/snippets/max_by.md +++ b/snippets/max_by.md @@ -5,11 +5,11 @@ tags: math,list,function,beginner Returns the maximum value 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 `max()` to return the maximum value. +Use `map()` with `fn` to map each element to a value using the provided function, use `max()` to return the maximum value. ```py def max_by(lst, fn): - return max(list(map(fn,lst))) + return max(map(fn,lst)) ``` ```py