Functional programming is a Programming Paradigm where programs are constructed by applying and composing functions. Functional programming evolved from Lambda calculus.
There is no commonly accepted definition of what exactly Functional Programming entails - but it is said to include concepts like pure functions, lazy evaluation, pattern matching. Some key concepts:
- no modifications of global state
- no modifications of data structures in place
- no exceptions thrown
- to be pure functional - no reading in of user input and writing out (for ex. to a file or network)

Example of addition in imperative style:
li = [1, 2, 3, 4]
total = 0
for i in li:
total = total + iSame example as above in functional programming style:
import functools
li = [1, 2, 3, 4]
total = functools.reduce(lambda x, y: x+y, li)Pure Functions
Pure functions are functions that only use (but don’t modify - immutable) the arguments passed to them in order to calculate the result. If it is called multiple times with the same arguments, it must return the same result every time. It will leave no trace that it was ever invoked (no side effects). This all implies that pure functions are unable to alter the state of the program.
This means however they can’t read from the standard input, write to the standard output, create or delete files, insert rows into a database, and so on.