7/16 Iterating Over a Hash ok i really need help with this one


#1

This is the code

lunch_order = {
"Ryan" => "wonton soup",
"Eric" => "hamburger",
"Jimmy" => "sandwich",
"Sasha" => "salad",
"Cole" => "taco"
}


#2

What are you trying to do and what is stopping you?
(Keep in mind that it's up to you to ask for the information you need)


#4

EDIT: Figured out the answer

lunch_order = {
  "Ryan" => "wonton soup",
  "Eric" => "hamburger",
  "Jimmy" => "sandwich",
  "Sasha" => "salad",
  "Cole" => "taco"
}
lunch_order.each{ |names, order| 
    puts order
}

after calling

lunch_order.each

you then need to reference the names and orders separately so that you are able to only print the order


I'm also having problems with this one. The object of this problem is to iterate over the hashes, but only print out the values of the keys. So the right answer should look like:
wonton soup
hamburger
sandwich
salad
taco

I'm not sure how to only print the values.