A method is defined using the keywords
end to frame a section of code:
def method_name method codeend
The method’s name will primarily contain letters, numbers, and the underscore. As you’ll see, there are a few other special characters that may be part (or all) of the method’s name, but stick to alphanumeric characters and the underscore to start. Conventionally, method names always begin with a lowercase letter and use underscores to break up words: print_this, not printThis or PrintThis.
The functionality of the method, which is to say the code that will be executed when the method is called, goes between the method’s name and
Using just the information provided, there’s not much that a method can do, but let’s ...