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 trialSharon Eller
3,090 PointsCreate a method named "create_shopping_list" that returns a hash
I'm pretty sure this code is correct. Can someone please tell me what I'm doing wrong?
def create_shopping_list
hash = {"name" => name }
return hash
end
2 Answers
Geoff Parsons
11,679 PointsThe value of name
is looking for a variable called name
. You'll need to have the value side of the arrow be a String literal with your name in it for instance.
def create_shopping_list
hash = {"name" => "Sharon" }
return hash
end
Sharon Eller
3,090 PointsThanks, Geoff! Its always the obvious that stumps me.