Functions

In this lesson, we will learn about functions in Python.

A function is a reusable set of operations. We don’t need to write the set of instructions again for different inputs, we can just call the function again.

There are two basic types of functions in Python:

  1. Built-in functions
  2. User-defined functions

It is good practice to define all our functions first and then begin the main code. Defining them first ensures that they can be used anywhere in the program safely.

Get hands-on with 1200+ tech skills courses.