There are times when we need to define a function in Python but this function will be used only in one point of the code, Python allows us to define lambda functions for these cases, which are nothing more than functions defined on the fly.
We will see this very clearly with a simple example:
>>> f = lambda x: x + 1
>>> f(3)
4