Learn

You won’t become a Master Method Maker ‘til you make a mess of methods. (Say that three times fast.)

def by_five?(n) return n % 5 == 0 end

The example above is just a reminder of how to define a method.

Instructions

1.

Define a method called greeter that takes a single string parameter, name, and returns a string containing that person’s name.

Make sure to return the string. Don’t use print or puts.

2.

Define a by_three? method that takes a single integer parameter, number, and returns true if that number is evenly divisible by three and false if not.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?