14. Becoming more selective - can't understand what is wrong here


#1



https://www.codecademy.com/courses/ruby-beginner-en-Qn7Qw/2/4?curriculum_id=5059f8619189a5000201fbcb

I keep getting the error message 'It looks like good_movies includes memento, but it shouldn't.'
Really can't work out what I have done wrong here.

Any help would be massively appreciated - thank you


movie_ratings = {
  memento: 3,
  primer: 3.5,
  the_matrix: 5,
  truman_show: 4,
  red_dawn: 1.5,
  skyfall: 4,
  alex_cross: 2,
  uhf: 1,
  lion_king: 3.5
}

good_movies = movie_ratings
movie_ratings.select {|movie, rating| movie > 3}


#2

Create a new variable, good_movies, and set it equal to the result of calling .select on movie_ratings, selecting only movies with a rating strictly greater than 3.

You should check if the rating is greater then 3, not the title of the movie. And please remember that you have to assign the result of this statement to the good_movies variable.

This line is not needed:

good_movies = movie_ratings

#3

really helpful - thank you so much!


#4

You're very welcome :slight_smile:


#5

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