Apply a function to all values of a dict. Example: {'a':1,'b':2}, func=lambda x: x*2 => {'a':2,'b':4} The second input line names the operation to apply — one of double, square, negate, increment or stringify — and the checker passes the matching function in as func.
Implement this function:
def map_values(d: dict, func) -> dict:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: d, func.
Input
{'a': 1, 'b': 2}
'double'
Output
{'a': 2, 'b': 4}