Error. 6


#1

HI,

I always get the "already exists" note. Even when I should not.

movies = {
    :ho => 4
}
puts "choice"
choice = gets.chomp
case choice
when "add"
puts "title"
title = gets.chomp
if movies[title.to_sym] = nil?
    puts "rating"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts "#{title}, has been added as #{rating}"
else
    puts "already exists"
end

when "update"
puts "Updated!"
when "display"
print "Movies!"
when "delete" 
puts "Deleted!"
else 
    puts "Error!"
end

#2

HI this line

if movies[title.to_sym] = nil?

the nil? should be like that

if movies[title.to_sym].nil?

#3

Hello, I ran your code and didn't get that output as you said but please do as @wizmarco said.