14. Why is there a mistake?


#1



Exercise 14.
I think, my code is correct... It prints b berry, but it get me a mistake below
Can somebody help me, please?


`python

d = {'a': 'apple', 'b': 'berry', 'c': 'cherry'}

for key in d:
if d[key] == 'berry':
print key, d[key]

Oops, try again. It looks like your code did not print "b berry".`


#2

You shouldn't have an if statement. If you get rid of that line, your code should work.


#3

Thanks :smile:
I didn' t expect such simple answer ...

You are my saviour :wink:


#4

No problem!


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.