What is functional programming?

Functional programming is a paradigm where the program is mainly an evaluation of (mathematical) functions, and is not through a series of defined steps that change the state of the program. Purely functional programs avoid the change of state (side effects) and mutable data. In Python, functional programming is realized through the use of complex expressions and declarations of functions.

One of the best ways to better understand the general concept of functional programming is through familiarizing yourself with the basic terms of functional programming:

Using these concepts, we could describe a purely functional language as a language that has first-class functions that is concerned only with pure functions, and avoids any state modification and side-effects. Python, of course, is not a purely functional programming language, and it would be really hard to imagine a useful Python program that uses only pure functions without any side-effects. Python offers a large variety of features that, for years, were only accessible in purely functional languages, so it is possible to write substantial amounts of code in a functional way, even though Python isn't functional by itself.

Let's take a look at Lambda functions in the next section.