Ruby Ruby Collections Ruby Hashes Working with Hash Values

Harsh Mankad
Harsh Mankad
4,650 Points

The 2nd part of the question is not clear.

Its not clear what the question is asking for.

grocery_item = { "item" => "Bread", "quantity" => 1, "brand" => "Treehouse Bread Company" }
grocery_item["food"] = "true"

1 Answer

Trevor J
Trevor J
Python Web Development Techdegree Student 2,080 Points

Ok so this is aking you to add food => true to the hash if there is a value with the name "Bread".