Functions

Learn about Python functions.

We'll cover the following

Definition

Functions are a series of statements that are used to perform a specific operation. In Python, there are two types of functions: built-in functions and custom-defined functions, the latter of which we will be discussing in this lesson.

Syntax

To define a function in Python, we use the def keyword along with the name of the function, a parenthesized list of parameters, and a colon. This is followed by the indented body of the function.

Get hands-on with 1200+ tech skills courses.