In Operator....help!


#1



I don't know why but it saids I'm wrong, that I didn't print all the keys. But I innocently did.


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


Oops, try again. It looks like you did not print out every key in my_dict.


my_dict = {
    'socks': 3, 
    'Iphone': 'expensive',
    'tis_a_bool': True 
    }
for key in my_dict:
    print key + ' ' + str(my_dict[key])


#2

In the instructions and they even emphasized it:

(You should use print a, b rather than print a + " " + b.)

They are also checking if you are doing key, my_dict[key] or key + ' ' + str(my_dict[key]) (I think). Make sure you are doing the former.


#3

So i do have my print statement in the Print(key, my_dict[key]) and I am still getting this error. All my value are printing normally.


#4

No brackets around key, my_dict[key]. Print needs to be all lowercase to print.


#5

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