Difference between map and dict
dictionary, hashmap, python
Solution
Map is not a datatype in python. It applies a function to a series of values and returns the result.
>>> def f(x):
... return x**2
...
>>> list(map(f, range(5)))
[0, 1, 4, 9, 16]
Often for a simple case like that to be "pythonic" we use list comprehensions.
>>> [x**2 for x in range(5)]
[0, 1, 4, 9, 16]
You are right in your comparison of hashmaps and dicts.
Problem
I might be confused between `hashmap` in Java, and `map`/`dict` in Python. I thought that the `hash` (k/v abstraction) of Java is kind of the same as `dict` in Python But then what does the `map` datatype do? Is it the same abstraction as the hashmap abstraction? If so, then how is it different from dictionary? I went through the docs, but it took me to whole together different paradigm: functional programming.