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.

hash.rb
grocery_item = { "item" => "Bread", "quantity" => 1, "brand" => "Treehouse Bread Company" }
grocery_item.has_value?("Bread")
grocery_item["food"] = "true"
grocery_item.has_value?("true")

1 Answer

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

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