Learn

Good! Now let’s create a hash. Feel free to use either hash literal notation or Hash.new.

prices = { "apple" => 0.52, "banana" => 0.23, "kiwi" => 1.42 } sounds = Hash.new sounds["dog"] = "woof" sounds["cat"] = "meow"

Instructions

1.

Create a hash called my_hash in the editor.

Give it at least one key-value pair.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?