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!
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
SY LOC3,233 Points
Create a method called "add" that takes two arguments and returns the sum of two numbers.
I typed below and it does't work. I created 2 arguments and give it a sum.
def add(a, b) puts a + b end puts add(2, 3)
You don't have to use twice puts statements, it should have either return or without return to sum up automatically. ;)
def add(a, b) return a + b end puts add(2, 3)