Problem with 'display'


#1

Having this same problem. This is my code:

when "display"
movies.each do |movie, rating|
puts "#{movie}: #{rating}"
end

My output is:

Input: display
space: 4
primer: 4
earth: 2

The error I get is:

It looks like your ‘puts’ doesn’t include space: 4.

I can’t move past the exercise


Display 8/10 won't work in Ruby
#2

Please post a link to the exercise. Thanks.


#3

Sorry, I thought I was replying to a post. It’s 8/10, Night at the Movies

The only way I got this to work was to manually ‘puts’ my first hash item, then have it print the rest. The output ended up looking like this:

Input: display
space: 4
space: 4
primer: 4
earth: 2

But I got through the exercise. Not sure what the problem was


#4

The link will be more helpful, please.


#5

https://www.codecademy.com/courses/learn-ruby/lessons/a-night-at-the-movies/exercises/display?action=lesson_resume


#6

Is you data symbolic?

movies = {
  :Crash => 4,
  :Babel => 4
}

#7

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