14/19 what s wrong with my code?


#1

somebody help me ~plz~

thank u so much!


#2

Your code is OK, but checker is just a machine :wink: Try this: print key + " " + d[key]


#3

:confounded:


#4

Which exactly exercise is it?


#5

Hi pythonmaster1031

The instruction for 14/19 says:

"On line 5, print the key, followed by a space, followed by the value associated with that key."

So you need to print all key and values pairs, not just b: berry. The below code works (just take your if statement out).

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

for key in d:
# Your code here!
print key, d[key]


#6

thank u so much spacecamel100

:joy:


#7

No problem - if you want to give my answer a 'like' that would be appreciated! :grinning: