I want to write a function that is able to convert a dictionary of lists, that are of equal length lists, into a list of dictionaries.
EX: {'a': [1, 2, 3], 'b': [3, 2, 1]} => [{'a': 1, 'b': 3}, {'a': 2, 'b': 2}, {'a': 3, 'b': 1}]
The thing I am caught on is how to code this without knowing the total length of the first dictionary, and being able to remove all hardcoded values out of the function.
My intuition was to try and use a defaultdict, but that didn't seem to help.
Any help would be much appreciated!