Yet another Prompting Redux Topic post


#1

Hello Wonderful Humans of Code Academy,

I have completed this exercise but only with the help of the forums here and would not have conceived the correct line of code without all of your efforts, so thank you.

When we are asked to: "Add that movie/rating pair to the movies hash and puts a message indicating the pair was added. (No need for to_sym or to_i just yet!)"

I do not understand how the following code works: movies[title] = rating

Is it simply saying to Ruby: Hey! Add [title] as a key to the movies hash with the value of rating!

And if this is the case - is it meant to be so simple and why is the title in brackets []? I spent more time on this problem than I care to admit and still feel dumbfounded by that line of code was responsible for moving the title / rating to the hash.

As a side - it did NOT actually add either the Title I input or the Rating into the Hash. Is the functionality not built into the code above? Am I merely getting a pass due to a glitch?

Thanks for your time