3. The case statement error


#1

https://www.codecademy.com/en/courses/ruby-beginner-en-0i8v1/0/3?curriculum_id=5059f8619189a5000201fbcb

Hello, i've got a problem on this step

when i run the code, it always show "It looks like your case statement doesn't puts 'Added!' when choice == 'add'."

Can anybody help me, please?Because I think my code has no problem.
Thanks

movies = {
    "AADC" => 4
}

puts "What would you like to do?"
puts "-- Type 'add' to add a movie."
puts "-- Type 'update' to update a movie."
puts "-- Type 'display' to display all movies."
puts "-- Type 'delete' to delete a movie."
print "input the option : "
choice = gets.chomp.downcase

case choice
when 'add'
    puts "Added!"
when 'update'
  puts "Updated!"
when 'display'
  puts "Movies!"
when 'delete'
  puts "Deleted!"
else
  puts "Error!"
end;


#2

@aditramadhan,
You will have to change your

into
puts "input the option : "


#3

@leonhard.wettengmx.n
Thanks :smiley: finally the code works well


#4

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