2. Setting Up


#1

Hi I urgently need help.....

here is my code:

movies = hash
{
'Zoolander' => 4
}
puts "Zoolander with a rating of 4"
choice = gets.chomp

Here is what it says:

"Oops, try again. It looks like movies isn't a hash."

I am lost.....would appreciate any feedback....and thankyou in advance!


#2
movies = {
  "Zoolander" => 4
}
movies.each { |name, rating|
  puts "#{name} with a rating of #{rating}"
}
choice = gets.chomp

#3

Does this answer your question btw?


#4

Hi there luyangliu1,

thankyou so much for your help! I have been looking at & analysing your code!

And yes with the added bit that you provided I have moved on!

So again cheers! Much appreciated! :wink:

Sam