16/19 Review


Not able to solve this one. What am I doing wrong here?

def welcome("Welcome to Ruby!")
puts "#{welcome}"

Keeps bombing out with syntax errors. I've tried return "#{welcome}" too, same story.


You're defining a method called welcome, fine.

You give it a parameter which will always be the same ("Welcome to Ruby!"), this is quite weird, because usually the goal of passing parameters to a method is useful because the parameters can change, so giving a static parameter will not accomplish much (and I doubt Ruby allows that anyway).

Then you're asking puts to display a string, which will be the result of the interpolation of the variable welcome, even though welcome is your method, and not a variable.

I suppose what you wanted to accomplish is a welcome method that changes according to the message you give it?

In this case, something like this works:

def welcome sentence
puts "#{sentence}"



Figured it out - thank you for your help!