A decorator takes in a function, adds some functionality and returns it.
Functions can be passed as arguments to another function like map, filter and reduce
Function that take other functions as arguments are called higher order functions.
Ex:
def inc(x):
return x + 1
def dec(x):
return x - 1
def operate(func, x):
result = func(x)
return result
print(operate(inc,3)) #4
print( operate(dec,3)) #2