I'm stuck!


I can't get past this stage. Here is my code:

def greeter(name)
return ("hello") name

def by_three?(number)
if number % 3 == 0
return true
else return false

The error message:

(ruby):1: syntax error, unexpected tIDENTIFIER, expecting keyword_end (ruby):9: syntax error, unexpected $end, expecting keyword_end

Where have i gone wrong.

Thanks in advance


There are two problems.

First one is in this line:

return ("hello") name

What does it mean? Your function returns "hello" and then you have name. The interpreter doesn't know what to do with this name. You probably want to do something like this:

return "hello " + name

And now, this is a single value.

The second problem is more trivial. You have to end your function and your if statement. You have to add one end at the last line.


Or return "hello #{name}"