Why the Return of both methods are not Printing on the Console?


#1

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

def by_three?(n)
return n % 3 == 0
end
by_three?(9)


#2

I'm not sure what you're asking here. Are you asking why you're not seeing the output on the screen? Or about the return function itself?


#3

Or are you asking something else entirely?


#4

why is dont work because reverse can you say?
fruits = ["orange", "apple", "banana", "pear", "grapes"]
fruits.sort! do {|secondfruits, firstfruits|secondfruits <=> firstfruits}
end


#5

if is necessary the fuction return to pass


#7

I'm sorry, I have no idea what you're trying to say


#8

it should be

def greeter(x = "name") => method is expecting a sting, it does not recognize 'name' as anything !

return "Welcome #{x} "
end
greeter(" Chris")