Functional Programming?
In this module, we are going to briefly take a look at what Python offers in terms of Functional Programming.
Functional Programming is yet another programming paradigm. In comparison to Object-oriented Programming (where everyting is an object), in Functional Programming everything is a function (well, sort of). You can pass functions as arguments, you can return functions. And recursions happen a lot in functional programming too!
Haskell and LISP are examples of purely functional programming languages.
Python of course attempts to be a jack of all trades, and offers some functional programming capabilities. The mathematicians among you might find these useful!
We will look at two functional programming features in Python:
- Lambda functions
- Higher order functions