Functions

Types of functions

There are two types of functions: internal functions (also known as built-in functions) and user-defined functions.

Internal (built-in) functions

Built-in functions are functions that exist within the programming language; such as Python. These functions can be invoked without writing them ourselves. These built-in functions are what make Python a very efficient and productive scripting language.

Follow the link to see the many types of built-in functions in the Python documentation.

For more information about Python functions, refer to this W3Schools page.

User-defined functions

User-defined functions are functions that you can create yourself to enhance Python.

User-defined functions come in handy when:

  • you have repeated routine tasks in your application, such as adding data to the database
  • performing validation checks on the data
  • authenticating users in the system
  • activities will be spread across a number of pages.