I'm interested in functional programming with python and am working through Mary Rose Cook's blog post A practical introduction to functional programming.
Apparently, it was written in python 2 as this:
name_lengths = map(len, ["Mary", "Isla", "Sam"])
print name_lengths
# => [4, 4, 3]
in Python 3 yields this:
<map object at 0x100b87a20>
I have two questions:
- Why is this is so?
- Other than converting the map object to a list and then use numpy, are there any other solutions?