The 'in' operator


Exercise 3 - The 'in' operator

I Think this code should work as it displays all the keys in my_dict however the error message says 'Oops, try again. It looks like you did not print out every key in my_dict.'

Please can someone explain what I'm doing wrong.

Thanks in advance

my_dict = {
    "animals": "zebra",
    "zoo": 3,
    "active": "true",
for key in my_dict:
    print key, my_dict[key],


What happens when you remove the last comma?


oh right, thank you. sometimes you just need someone to take another look at spot things out.


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