Travis build: 115
This commit is contained in:
@ -800,11 +800,11 @@ min_n([1, 2, 3], 2) # [1,2]
|
||||
|
||||
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 `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)
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
Reference in New Issue
Block a user