Exercise 1: Create a Hash
Practice creating a hash.
We'll cover the following
Problem statement
Create and return a hash with the values “one”
, “two”
, and “three”
stored against the keys “uno”
, “dos”
, and “tres”
, respectively.
Example
Expected Output: { "uno" => "one", "dos" => "two", "tres" => "three" }
Try it yourself
def create_hash()result = {}# Start your code herereturn resultend