Key/value doesn't get added to the Hash


Hi! I’m stuck on the Night at the Movies exercise, “Prompting: Redux!”

It keeps telling me “Oops, try again. It looks like you didn’t add to the movies hash!” I don’t understand what’s wrong… Can anyone help? Here’s my code:

movies = {
    Frozen: 5,
    Batman_begins: 5,
    Birdman: 1
puts "Please put ADD to start rating movies!"
choice = gets.chomp

case choice
when "add" 
    puts "What movie would you like to rate?"
    title = gets.chomp
    puts "How would you like to rate this movie?"
    rating = gets.chomp
    movies[title] = rating
    puts "#{title} has been added with the rating #{rating}"
when "update"
    puts "Updated!"
when "display"
    puts "Movies!"
when "delete"
    puts "Deleted!"
    puts "Error!"


What is your exact input after you start the program?


HI When you Save & submit the code you should first type add the type the name of the movie you want to add…



This is what I get ont he console:

Please put ADD to start rating movies!



oh man… you were right, ugh I fell so stupid now :smiley: Thanks for your help :slight_smile:


Yah, so you have to give your program some input and you’ll be fine. Do “add” then add some movies ^^


Thank you! :blush: sometimes all you need is an new eye to evaluate the situation lol