I have a dictionary with the following format
{'bye': ['yellow', 'green', 'orange', 'purple'],
'hello': ['red'],
'hi': ['red', 'blue']}
What I'm trying to do is count all the values in this dictionary, no matter what the key is, no matter if the values have the same name, if its there count it.
So far i have
mynumber = 0
for key, value in mydict.iteritems():
mynumber +=1
return mynumber
This output only give me the total number of keys, what i want is the sum of all values, repeated or not. So in this instance mynumber should be 7