Methods with Arguments


#1



https://www.codecademy.com/courses/ruby-beginner-en-ET4bU/4/2?curriculum_id=5059f8619189a5000201fbcb#


So i feel as though I've done everything correctly but it still returns the error message "make sure your method takes a single string parameter." And i have given it a single string parameter. What am i doing wrong? can someone please point me in the right direction?


def welcome (n)
    return "Hello, #{name}"
end

welcome ("robert")

https://www.codecademy.com/courses/ruby-beginner-en-ET4bU/4/2?curriculum_id=5059f8619189a5000201fbcb#


#2

In the instruction they asked to do this..

Change your welcome method definition. Add a single string parameter called name.

def welcome (n) ?
Your parameter is n ?


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.