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 trialEric Carter
2,130 PointsWhat is the challenge task asking for?
I did what the prompt asked for but it doesn't seem to be registering with what the task is asking for?
def create_shopping_list
print "What is the list's name?"
name = gets.chomp
hash = {"name" => name, "items" => Array.new }
return hash
end
2 Answers
Manish Giri
16,266 PointsThe challenge linked in your question is this -
Create a method named "create_shopping_list" that returns a hash. It does not need to ask for a name or get anything from standard input.
For that you just need to return a new Hash from the method -
def create_shopping_list
Hash.new
end
Ari Misha
19,323 PointsHiya there! The challenge just wants you to create a method called create_shopping_list and it doesnt need to return anything other than an empty hash. Its pretty straightforward , but i'll still attach the code with my answer.
def create_shopping_list
{}
end
~ Ari
Eric Carter
2,130 PointsOhhhh okay it went right over my head! Thanks a lot.
Eric Carter
2,130 PointsEric Carter
2,130 PointsAhhhh okay okay thanks a lot!