So I have an example below :
movies = {
dobby: "dobster is a lad",
pirates_of_the_carribean: "Its all about jack sparrow kicking ass!"
}
puts "what do you want to know about?\n
#{movies[:dobby]}. = 1\n
or...\n
#{movies[:pirates_of_the_carribean]}. = 2\n
Pick a number :"
Now what I get is the value
of the key but I am looking to get the Key
so that puts
will output just the key
and not the value
.
I understand that the solution will likely output the key as :key
and not key
so id also like to know how to return a key without the ":" for displaying purposes.
Note : I have done thorough searching using google and haven't found a solution to this issue.