0

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?

martineau
  • 119,623
  • 25
  • 170
  • 301

1 Answers1

0

You can do this as follows:

c=0
for i in d.values():
    if i=='Fred':
        c+=1
print(c)