Ruby Ruby Loops Build a Simple Contact List Assigning Hash Values From Methods

how should this task be completed. The instructions seemed clear. Checked video several times for clarification. Help.

if anyone could tell me what im doing wrong that would be great

contact_list = []

contact = {"name" => "", "phone_number" => "" }
def get_name()

  return "Hi"
contact["name"] = get_name()
Michael Gasser
Michael Gasser
4,070 Points

You've got the right idea! However, the instructions say to assume that the get_name() method already exists and returns a string. So if you remove your custom method definition you should be good to go!

1 Answer

thank you