Skip to content

Latest commit

 

History

History
 
 

13 - Functions

Functions

Functions allow you to take code that is repeated and move it to a module that can be called when needed. Functions are defined with the def keyword and must be declared before the function is called in your code. Functions can accept parameters and return values.

def functionname(parameter):
    # code to execute
    return value