Map dictionary values
Creates a dictionary with the same keys as the provided dictionary and values generated by running the provided function for each value.
- Use
dict.items()to iterate over the dictionary, assigning the values produced byfnto each key of a new dictionary.