diff --git a/snippets/none.md b/snippets/none.md index b12512d2b..a99ecb388 100644 --- a/snippets/none.md +++ b/snippets/none.md @@ -5,11 +5,11 @@ tags: list,function,intermediate Returns `False` if the provided function returns `True` for at least one element in the list, `True` otherwise. -Use `all()` in combination with `map()` and `fn` to check if `fn` returns `False` for all the elements in the list. +Use `all()` and run `fn` to check if `fn` returns `False` for all the elements in the list. ```py def none(lst, fn=lambda x: x): - return all(map(lambda x: not fn(x), lst)) + return all(not fn(x) for x in lst) ``` ```py