Ruby Ruby Basics Ruby Syntax Method Arguments

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


def say(l)
  puts l
  puts "Ruby"

say l

1 Answer

Steven Parker
Steven Parker
182,438 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