Glitch or bad code for "Greeter" method?


Hi folks, think I might be getting a glitch and can't seem to figure out how to clear it up. I'm working on the greeter method exercise. I'm getting the error message:

"It looks like your greeter method prints to the console instead of using return."

But my code includes return and not print or puts. Any ideas? Thanks!!

Link to exercise:

print "What's your name?"
name = gets.chomp

def greeter(name)
    return "Hi #{name}"

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


Wow okay just used "puts" and it worked. Very misleading error message!!


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