Delcare a Function

You can declare a new function using the def keyword followed by the function name.

def functionName(parameters):
    code to be executed in function

If the function takes parameters, you can include these in parenthesis next to the function name.

So for example, if we wrote a function to add two numbers together, we could write something like this:

def addNum(num_1, num_2):
    return num_1 + num_2

This function takes two numbers as parameters, adds them together, and returns the result.