16.Iterating Over a Hash


#1

Whats wrong with my code?
lunch_order = {
“Ryan” => “wonton soup”,
“Eric” => “hamburger”,
“Jimmy” => “sandwich”,
“Sasha” => “salad”,
“Cole” => “taco”
}

lunch_order.each do|name,order|
puts " #{order}"
end


#2

Maybe nothing. Without context we have nothing to go by. Please post a link to the exercise.


#3

The problem is that you have a blank space in this line

puts " #{order}"

The line of code should go this

puts "#{order}"

#4

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