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

Ruby Ruby Basics (Retired) Ruby Methods Method Arguments: Part 1

Monica Kornis
Monica Kornis
Courses Plus Student 1,132 Points

How to create a method named an argument?

See the code below. What errors are occurring in my argument?

def hello
  puts "Hello i am #{name}" 
  name = Monica 

1 Answer

Jason Anders
Jason Anders
Treehouse Moderator 145,841 Points

Hey Monica,

You seem to have way more code that what the challenge is asking for. It didn't ask for a puts statement and didn't ask for a variable to be defined.

The challenge only wants you to define a method named "hello" that takes one argument.

Below is the corrected code for your reference. If it doesn't make sense, I do strongly recommend rewatching the first two videos of the course before moving on, as this is fundamental in what is to follow. :)

def hello(arg)