I'm working with dictionaries and was wondering how I could output a dictionary where its key is the word that occurs in a given dictionary and its value is the number of times it occurs within that dictionary.
So say for example,
A = {'#1': ['Yellow', 'Blue', 'Red'], '#2': ['White', 'Purple', 'Purple', 'Red']}
B - []
for key in A:
B.append(A[key])
>>> B
>>> [['Yellow', 'Blue', 'Red'], ['White', 'Purple', 'Purple', 'Red']]
Run Code Online (Sandbox Code Playgroud)
After returning the respective values of the keys, I …