9 - Delete


#1

when "delete"
title = gets.chomp
if movies[title].nil?
puts "Error: the movie is not in the Hash!"
else
movies.delete(title.to_sym)
end

What's wrong with my code? Help please :slight_smile:


#2

HI these lines

title = gets.chomp
if movies[title].nil?

you should .to_sym both gets.chomps and title

Spoiler

title = gets.chomp.to_sym
if movies[title.to_sym].nil?


#3

Thanks my N-Word :sunglasses: :sunglasses: :sunglasses:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.