Resolved: Advanced Topics in Python: the 'in' operator


#1

I'm trying to resolve exercise number 3 in the section "Advanced topics: the 'in' operator".

Link:
https://www.codecademy.com/courses/python-beginner-en-KAgt5/0/3?curriculum_id=4f89dab3d788890003000096

My code is:

my_dict = {
"Name" : "John",
"Surname" : "Smith"
}

for i in my_dict:
print "%s %s" % (i, my_dict[i])


I obtain this error: Oops, try again.
It looks like you did not print out every key in my_dict.


The console return the right data and I can't understand this error.
I tried the code on the python environment and it works properly.



#2

it is SCT (submission correctness test), that you use "%s %s" % (i, my_dict[i]) instead of just simply doing:

print i, my_dict[i]

both are correct, but you can only use this one to pass the exercise


#3

Many thanks for your help!