Complete the code to access the value of key 'name' in the hash.
person = {"name" => "Alice", "age" => 30}
puts person[[1]]In Ruby, to access a value in a hash with string keys, you use the string key inside brackets.
Complete the code to set the value of key :age to 25 in the hash.
person = {name: "Bob", age: 20}
person[[1]] = 25
puts person[:age]When the hash uses symbol keys, you must use the symbol to access or set values.
Fix the error in the code to correctly access the value of key :city.
location = {city: "Paris", country: "France"}
puts location[[1]]The hash uses symbol keys, so you must use :city to access the value.
Fill both blanks to create a hash with keys as strings and values as integers.
scores = {"math" => [1], "science" => [2]
puts scoresThe keys are strings, so the values should be integers without quotes to represent numbers.
Fill all three blanks to create a hash with symbol keys and update one value.
person = {name: [1], age: [2], city: [3]
person[:age] = 40
puts personSymbol keys are used with values: a string for name and city, and an integer for age. The age is updated later.