Lesson 12, 8/10

Greetings, It’s that time again when an inaccurate error message gets in the way of progress.

As you can see selecting display displays the whole content of the hash so the message/hint is inaccurate. Hint/message: “It looks like your ‘puts’ doesn’t include love: 8.”

https://www.codecademy.com/courses/learn-ruby/lessons/a-night-at-the-movies/exercises/display?action=resume_content_item

movies = Hash.new
movies = {
love: 8,
ordinary: 15
}
puts “input add or update or display or delete”
choice = gets.chomp

case choice
when “add”
puts “Plase enter the movie title”
title = gets.chomp

now check to see if key is already present

if movies[title.to_sym].nil?
puts “Plase enter the movie’s rating as a whole number”
rating = gets.chomp

now write the key/value pair to the hash table

movies[title.to_sym] = rating.to_i
puts "The key/Value has been added!"

else
puts “The movie already exists”
end # end of if
when “update”
puts “Plase enter the movie title”
title = gets.chomp
if movies[title.to_sym].nil?
puts “The movie does not exist”
else
puts “Plase enter the movie’s rating as a whole number”
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts “The Value has been updated!”
end # end of if
when “display”
movies.each do |title, rate|
puts “#{title} #{rate}”
end # end movies.each
when “delete”
puts “Deleted!”
else
puts “Error!”
end # end of case

looks accurate to me, the text in the error message is indeed not in the output, and the instructions do ask for it so it should be there

you might be falling for that there’s something similar so therefore you draw the conclusion that it’s there.