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

Derek Hutson
Derek Hutson
9,740 Points

Weird question.. what am I doing wrong?

Hi all, I keep getting a syntax error and not sure why.. Thanks for help!

methods.rb
def three(3)
end

def five(5)
end

1 Answer

Hey Derek. In this challenge you're being asked to return 5 and 3 respectively in your two functions. Right now you're passing in 5 and 3 as parameters to your functions. Instead of passing in the numbers as parameters, use the return keyword inside the body of your functions. Syntax example:

def ruby_func()
  return value
end

I hope this clears things up!

Derek Hutson
Derek Hutson
9,740 Points

Got it.. asking for no argument threw me off so I didn't put anything in the body!