Skip to Content
Methods, Blocks, & Sorting
Methods With Arguments

Good! Now let’s make our method a bit more complex by adding arguments and a return statement.

def double(n) return n * 2 end



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

Remove your puts statement and replace it with return "Hello, #{name}"

Folder Icon

Take this course for free

Already have an account?