Nothing in the terminal window

Hi,

So I ended up with the following code for this exercise:

creatures = { “weasels” => 0,
“puppies” => 6,
“platypuses” => 3,
“canaries” => 1,
“Heffalumps” => 7,
“Tiggers” => 1
}
puts creatures[“dogs”]

And the response was:

Nothing in the terminal window.
But the following error message was displayed at the bottom of the screen below the code:
Did you try to access a key in the creatures hash that doesn’t exist?

Am I missing something here?
What is the point of this exercise?

The requirement is to " Go ahead and try to access a key in creatures that doesn’t exist."
By using: puts creatures[“dogs”]
I am trying to access a creature that doesn’t exist, yet I am not permitted to go to “Next” as it is still greyed out.

If I input just: creatures[“dogs”] i.e. no puts
Then I am permitted to go “Next”

Confused - I am…

Would appreciate someone explaining why this is the case.

Well, did you? Actually, yes! There is no, ‘dogs’ key in that hash.

Hi,

What I am actually confused about is the fact that my answer was not permitted to be correct when in fact I believe it was.

I should have been able to go to “Next”

What is this?

puts creatures[“dogs”]

It was my attempt to “try to access a key in creatures that doesn’t exist.”
In the same manner that: creatures[“dogs”]
attempts to do the same thing without displaying the resulting value in the terminal panel.

Perhaps I am expecting the parsing of the code for a correct answer to be more complex.
I agree that the displayed error message “Did you try to access a key in the creatures hash that doesn’t exist?” is correct,but it seems to me (happy to be corrected if I am wrong) the actual answer: creatures[“dogs”] should have produced the same error message.