Learn
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
Instructions
1.
Change your welcome
method definition. Add a single string parameter called name
.
Remove your puts
statement and replace it with return "Hello, #{name}"