14. Why is there a mistake?


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


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".`


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


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

You are my saviour :wink:


No problem!


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