1 min readJun 21, 2019
Hello, Susovan. I guess that you’re using Python 2. There is a different behavior for the map
and filter
functions between the Python 2 and Python 3 versions.
In Python 3, the
map()
andfilter()
functions return iterators (map
orfilter
objects, respectively). In Python 2, they returned lists.
Source: https://portingguide.readthedocs.io/en/latest/iterators.html