Code works but I added .to_sym and .to_i to the gets.chomp call. Noticed in the example code it's added to movies[title.to_sym] when adding the movie to the hash. I'm wondering if there's an advantage of doing it one way over the other? Does it tax the system less to only convert when adding to the hash? Would make sense since it could jump to the else statement without doing any conversions.
when "add" puts "What movie do you want to add?" title = gets.chomp.to_sym if movies[title.to_sym].nil? puts "What rating do you want to give it? (from 1 - 4)" rating = gets.chomp.to_i movies[title] = rating puts "Your movie was added!" else puts "This movie already exists in the database!" end