The `greeter` method


#1

https://www.codecademy.com/courses/learn-ruby/lessons/methods-blocks-sorting/exercises/practice-makes-perfect-1?action=lesson_resume

def greeter(name)
return "Hello There, " + name
end

greeter(name)


#2

Is there a question to go with this topic? Are you getting any error message?


#3

Hi, this is for Methods, Blocks and Solving part 8 Practice Makes Perfect. The instructions given to me are:

1.Define a greeter method that takes a single string parameter, name, and returns a string greeting that person.

Make sure to use return and don’t use print or puts.

and the code that I wrote is :

def greeter(name?)
return "Hello There, " + name?
end

greeter(name?)

The error i got is:
Your code threw the following exception: (ruby): syntax error, unexpected tFID, expecting ')'
def greeter(name?)


#4

? seems like a modifier to me. Would an identifier have this appendage?


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.