The `greeter` method


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



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


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?


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


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


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