4. Question about movies[title] = rating


movies[title] = rating

How does this work? Does this add the movie you entered in gets.chomp to the movies hash?


The variable title contains the title entered by the user.

The variable rating contains the rating entered by the user.

With this line of code, we're creating a key with title and the corresponding value to this key with rating, all this in the hash movies.