Problem with 9. Accessing Hash Values

ruby
sct

#1

This lesson will only let you pass if you use text as the value. I tried this horrible code below and it would not let me pass:

pets = Hash.new
pets["S"] = 1
pets["s"] = 2
puts pets ["S"]
puts pets ["s"]

But this will:

pets = Hash.new
pets["S"] = "a"
pets["s"] = "b"
puts pets ["S"]
puts pets ["s"]


#2

Is this a question or a platform issue?


#3

Issue. The platform does not identify a correct answer.

The example uses the string data type, but it says in the instructions that the key and value pairs can be any data type. I tried a different data type and it said "oops you didn't print the values" but I did print them.


#4

Re-assigning this topic to Platform Problems and Suggestions.