Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Basics (Retired) Ruby Methods Method Arguments: Part 1

Takuji Sakashita
Takuji Sakashita
3,372 Points

Create a method called hello that takes one argument.

what should i do to answer this question?

method.rb
def hello(a,b)
  puts a+b
end
Brian Pedigo
Brian Pedigo
23,469 Points

It 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.

def hello(arg)
end

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,623 Points

Hi 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! :dizzy: