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 trial

Ruby Ruby Basics Ruby Syntax Method Return Values

MaryAnn Eleanya
MaryAnn Eleanya
8,626 Points

The program isn't recognizing my arguments.

The program isn't recognizing my arguments.

methods.rb
def three(first, second)
    first- second
end

def five( first, second)
      first+second
end

 three(8,5)
  five(2,3)

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi MaryAnn,

First, I've deleted the duplicate question you asked just prior to this one. Please refrain from multiple postings for the same question in the Community.

Next, the task does not ask for any parameters, so that is why you are getting an error. Instructions for tasks are very specific and need to be followed exactly. So, first, you need to remove the parameters you have for the function and just have a function with no parameters. Next, the instruction ask to return a specific value, but you seem to be doing a calculation. Finally, the instructions do not say to call the function, so you'll need to remove the function calls you have.
Other than that, your structure looks good, just fix those up and everything will pass. :thumbsup:

Have a look at the example below to see what I mean by the explanations above:

def MyFunction() #no parameters
  return 7 #returning a specific value
end

Give it another go. I'm sure you'll get it now. :) :dizzy: