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 Arguments

I keep getting 'undefined local object...' Please provide my with the correct answer to this quiz,

thanks

say.rb
def say(l)
  puts l
  puts "Ruby"
end 

say l

1 Answer

Steven Parker
Steven Parker
231,236 Points

Code challenges are not like quizzes and often do not have a single "answer". Unless the instructions specify otherwise, any code that achieves the objective will pass the challenge. But here's some hints:

  • parameter names have some restrictions, and one is that a parameter name cannot be a number
  • you'll only need one "puts" in the function
  • when calling a function, the function name should be followed by parentheses
  • if the function takes an argument, the argument goes inside the parentheses