16/19 basic methods


#1

can someone help me to check whether my code is correct?
I pass but it seems weird.

def welcome(ruby)
return " welcome to #{ruby}"
end


#3

As embarrassing as this probably is, I too am having problem progressing past this lesson.

I do not under stand why my code isn't being accepted:

def welcome("Welcome to Ruby!")
return welcome
end


#4

Yup, I'm an idiot. Here is the proper code:

def welcome
return "Welcome to Ruby!"
end

puts welcome


#5

ok. thank you. I guess it works too. :smile:


#6

It's funny my code passed and looked ie this:

def welcome
     welcome = "Welcome to Ruby!"
end

puts welcome

Then I came here because that didn't seem like it should be the correct answer at all . . . .


#7

def welcome
puts "Welcome to Ruby!"
end

welcome


#8

This works as the result is the same, but it doesn't follow the instructions.

You are supposed to puts "Welcome to Ruby!" within the method, then call the method on it's own – not puts the value returned by the method.

scriptslay30587 does it right here:

def welcome
puts "Welcome to Ruby!"
end

welcome

#9

hkdeven you are not an idiot, learning new stuff is not easy.