Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAlex Ignat
8,538 PointsAssign the value of the key name to the return value of the method get_name() in the contact hash. Assume that get_name(
I've been stuck on this question for a while
contact_list = []
def get_name()
contact = {"name" => "", "phone_number" => "" }
contact["name"]
return contact
end
2 Answers
William Li
Courses Plus Student 26,868 Pointscontact_list = []
contact = {"name" => get_name, "phone_number" => get_phone_number }
ARNOLD SANDERS
5,266 Pointsdef get_name
contact = {"name" => "Joe", "phone_number" => "" }
return contact["name"]
end
and then call it:
get_name
Alex Ignat
8,538 PointsThanks!
Alex Ignat
8,538 PointsAlex Ignat
8,538 Pointsohhh lol. much easier than i thought.
thanks!