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

Dharma Teja
PLUS
Dharma Teja
Courses Plus Student 5,206 Points

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

def multiply(a, b) puts a+b end multiply(5,5)

method.rb
def multiply(a, b)
  puts a+b
end
multiply(5,5)

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Dharma,

It looks good, but it is not exactly what the Task is asking for. And, it looks like you deleted the code from Task One? All code you enter needs to be there.. you build upon it with each task.

So you need to add back in the code for Task one. Then for task two, it just wants the method... it didn't ask for the equation inside the method or the puts, nor did it ask you to call the method. So, you do have the correct code, you just need to delete the rest that wasn't asked for and put back the method you created in Task 1.

At the end of Task 2, there should be 4 lines of code (2 for each method creation).

Hope that helps.

Keep Coding! :) :dizzy: