Complete the code to create a hash with a symbol key :name and value "Alice".
person = { [1] => "Alice" }The symbol :name is used as a key in the hash.
Complete the code to create a hash with a string key "age" and value 30.
person = { [1] => 30 }The string "age" is used as a key in the hash.
Fix the error in the hash creation by completing the code with the correct symbol key.
person = { [1]: "Bob" }When using the symbol key shorthand, the key is written without the colon prefix, just the name.
Fill both blanks to create a hash with symbol key :city and string key "country".
location = { [1] => "Paris", [2] => "France" }The first key is a symbol :city, the second key is a string "country".
Fill all three blanks to create a hash with symbol keys :name and :age, and string key "city".
person = { [1] => "Eve", [2] => 28, [3] => "Berlin" }The keys are symbol :name, symbol :age, and string "city".
