Use to create a new hash called pets


pets_Hash = {
"pets" => "cats"
puts pets_Hash["pets"]

where is problem?


Can we start with what the problem is before we move on to where?


thx man,english is not my first language,Thank you for correction


I meant that you haven't described what the problem is, so others won't know what problem you are talking about. Why do you say that there is a problem? What are you trying to change?


when i clike on save & submit code it say Oops, try again. Did you declare a variable called pets?


Seems pretty straight-forward doesn't it?

pets = 5


pets_Hash = {
"pets" => 5
puts pets_Hash["pets"]

Still not working :((


Why should it though? You still haven't created a variable named pets.
In my previous example I created a variable by that name and assigned it to the value 5


so sorry .can u learn me that how can i make a variable?!if u have a free time :expressionless:


Type the name, then the assignment operator, then the value

pets = 5


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