norminette ex06
This commit is contained in:
@@ -5,7 +5,8 @@ def ft_filter(function, iterable):
|
|||||||
Return an iterator yielding those items of iterable for which function(item)
|
Return an iterator yielding those items of iterable for which function(item)
|
||||||
is true. If function is None, return the items that are true."""
|
is true. If function is None, return the items that are true."""
|
||||||
|
|
||||||
# iter https://docs.python.org/3.10/library/functions.html?highlight=iter#iter
|
# iter
|
||||||
|
# https://docs.python.org/3.10/library/functions.html?highlight=iter#iter
|
||||||
if function is None:
|
if function is None:
|
||||||
return iter([item for item in iterable if item])
|
return iter([item for item in iterable if item])
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user