Functions

A function packages code under a name and hands back a value with `return`.

Define with `def`, list parameters in parentheses, and use `return` to send a result back. A parameter can have a default. A function with no return gives back `None`.

def area(w, h):
    return w * h

print(area(3, 4))   # 12

More lessons in Control flow & functions