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 (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?