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 trialTakuji Sakashita
3,372 PointsCreate a method called hello that takes one argument.
what should i do to answer this question?
def hello(a,b)
puts a+b
end
2 Answers
Jason Anders
Treehouse Moderator 145,860 PointsHi Takuji,
Your code is correct syntactically, but it is not what the challenge asked for. The challenge wants you only to
Create a method called
hello
that takes one argument.
But, in your code, the method has 2 arguments instead of just one as per the instructions.
Second, the challenge just want a method, it did not ask for a puts
statement or anything else to be inside the body of the method.
If you fix those two things up, the code will pass. :)
Keep Coding!
Takuji Sakashita
3,372 PointsThank you for your answer!
Brian Pedigo
26,783 PointsBrian Pedigo
26,783 PointsIt looks like you put more effort into answering the question than is required. To pass this challenge just create a method that takes one argument. Notice the question doesn't ask for any internal logic in the method! Therefore, to pass this you could simply put.