Practice makes perfect? Help!


#1

Hi there I am stuck. :frowning:

def greeter(name)
return "Welcome" + name + "."
end
greeter (" your name" )

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

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

end

by_three?(9)
end

any helpers out there???


#2

Well looks like you over complicated it is looking for the code above 8


#3

This works:

def by_three?(number)
if number % 3 == 0 # if (number) / 3 gives modulus of 0
return true
else
return false
end
end


#4

I'm not really sure what to do for this one.

name = "hellooo"
def greeter(name)
return "Greetings "+name
end

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


#5

I am trying the code below:

def greeter(name)
return "Hello " + name + "!"
end

name = "Paul"
hello = greeter(name)

---- when I run it, I get an error message:
Oops, try again. It looks like your greeter method prints to the console instead of using return.

I haven't used the puts or print as the instructions indicated. Can anyone see what's wrong?
Thanks!


#6

thank you very much for the support


#7

Hi can anyone help me with this? I can't seem to get it right.

def greeting(name)
return "hello" + name
end

greeting(tracy)

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

by_three?(6)


#8

Hey, I am stuck with this Practice anyone have any idea please help!
def greeter(name)
return "Hello" + name
end
def by_three(n)
return true
if n % 3 == 0
else
return false
end
end
by_three(12)