Remove redundant map

This commit is contained in:
Bakhtiyor Ruziev
2019-09-25 15:45:25 +03:00
committed by GitHub
parent 06c866e0af
commit f2b6ae351e

View File

@ -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