Back Navigation Next Navigation Conceptual Review (page 46 of 55)

We can divide Python functions into the following:

1) Built-in functions - Functions that are built into base Python or a package/module that we import. Examples of these include max(), min(), input(), print(), type(), map(), & filter(). Python has a wealth of built-in functions that we can leverage in our scripts.

2) User-defined functions - Functions defined by the programmers themselves. These functions perform unique tasks that we need to accomplish, possibly reading in data from a json file and parsing the relevant data elements. That custom function and the logic therein would have to be developed by us.

There are two parts to user-defined functions in Python. We first have to define the function and then we have to call the function. Just defining the function does not actually execute the code within the function. We have to call the function to execute the code within the function.