Oops, try again. Your syntax doesn't look quite right. Check the examples in the instructions if you need help!


#1



can you check my code? thanks.


movie_ratings = {
  memento: 3,
  primer: 3.5,
  the_matrix: 3,
  truman_show: 4,
  red_dawn: 1.5,
  skyfall: 4,
  alex_cross: 2,
  uhf: 1,
  lion_king: 3.5
}
# Add your code below!

my_hash.each_key {|k| puts k}


#2

Two things:

my_hash.each_key {|k| puts k}

my_hash is not defined, but movie_ratings is. The exercise is asking us to use movies as our hash.

.each_key is unfamiliar to me, but .each is. So,

movies.each { |x| puts x }

The other thing is the names. They should be the exact same as the proper name. White space must in quotes.

movies = {
    "The Matix" => 3,
    "Lion King" => 3.5
}

You want to be able to find films by their name, not an arbitrary label.


#4