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 2

Benjamin Miller
Benjamin Miller
4,344 Points

Create a method called "subtract" that takes two arguments.

When i did this, it didn't work! so.... any ideas?

method.rb
def multiply(warg, barg)
end

It is asking you to make a method called subtract, not multiply. You should do this instead:

def subtract(num1, num2)
end
Benjamin Miller
Benjamin Miller
4,344 Points

Oh, oops i put in the wrong code. The thing is though, when i got to the multiply part it said that subtract hadn't worked! Whaaaaa!!!!?????

I'll try the challenge out. Just wait...

Sorry for the late response, but I got it! The answer is you replaced the method. You should of written it below the code you had written before. The answer:

def subtract(num1, num2)
end

def multiply(num1, num2)
end

~ Hope it helps! xela888

Benjamin Miller
Benjamin Miller
4,344 Points

omg, Thanks!!!!! LIFESAVER!

No problem!

2 Answers

Kenny Moreno
Kenny Moreno
3,406 Points

Challenge Task 2 of 2

Create a method called "multiply" that takes two arguments.

Oops! It looks like Task 1 is no longer passing.

method.rb

def multiply(num1, num2)

end

It does not work I am paying my money in vain please help your web app is not working - thanks!

Marwan Hassama
Marwan Hassama
865 Points

Surely numbers instead of 'num1, 'num2' should aslo work. Cant numbers be arguments?