Practice isn't making perfect


#1

OK, I can't figure this out...
If I submit this as is it says "false" and way to go.
If I comment out the last line (#by_three(13)) it says "Howdy Judy" and way to go.
But it won't do both as it should.
either way it is wrong but it tells me it is right?
def greeter(name)
return "Howdy, #{name}"
end
def by_three?(n)
return n % 3 == 0
end

greeter("Judy")
by_three(13)
Please help...


#2

I got stuck here for a minute.
I messed up a couple of times before I got the right syntax, but for some reason it still wasn't accepting it. Try resetting the code button at the bottom and retype what you just did. It worked for me and it was the same code as yours.


#3

I reset the code (again) and started from scratch... No Joy!
It still says 'false' unless I # it out then it says Howdy, Judy
It won't do both
thanx for trying


#4

Have you tried just putting in the code without

greeter("Judy")
by_three(13)


#5

Yep,
It says 'nil' and way to go... proceed


#6

Sorry, it says congratulations you have finished this section


#7

Yes, if you look in the instructions for the section, it says to define the methods, not call them. That should help clarify why your initial entry didn't work. Cheers, mate!


#8

this code worked for me.

def greeter(name)
return "i'm doing good #{name}"
end

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

greeter("Paul")
by_three?(9)

end


#9

def greeter(name)
return name
end

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

This is what I finally did and it let me through but I'm skeptical about my first answer


#10

Just finished this as well. I had to get the syntax correct before it worked and just like @courserunner92193 mentioned, the directions says to define the methods and not call them.

So I just relearned how fundemental reading is. lol.

 def greeter (name)
    return "What's up #{name}?"
end

def by_three?(number)
    return number % 3 == 0
end