Lesson 9 question


OK, so I got stuck for hours on lesson 9 and couldn't figure out what i was doing wrong. So I finally decided to "cheat" to find out what I was doing wrong. So the part I was messing up on was the movies.delete(title.to_sym) part. I had the brackets [], while I was suppose to be using the parenthesis. Can someone explain why I use parenthesis on the else statement instead of brackets?

`when 'delete'
  puts "What movie do you want to delete?"
  title = gets.chomp
  if movies[title.to_sym].nil?
    puts "Movie not found!"
    puts "#{title} has been removed."


Hi @deadendstreet,

Hint: movies.delete is a method. You have to put parenthesis to call a method. Brackets are used to access elements from arrays and objects.


actually in my case when i remove puts"delete" its showing the same result -nil-.........why is it so?