If I have a dictionary:
d = {0:'Fred', 1:'Fred', 2:'Zippy', 3:'Bob'}
how can I find out how many times "Fred"
occurs in it?
If I have a dictionary:
d = {0:'Fred', 1:'Fred', 2:'Zippy', 3:'Bob'}
how can I find out how many times "Fred"
occurs in it?
You can do this as follows:
c=0
for i in d.values():
if i=='Fred':
c+=1
print(c)