Why does foo = filter(…) return a , not a list? [duplicate]
Have a look at the python documentation for filter(function, iterable) (from here): Construct an iterator from those elements of iterable for which function returns true. So in order to get a list back you have to use list class: shesaid = list(filter(greetings(), [“hello”, “goodbye”])) But this probably isn’t what you wanted, because it tries to … Read more