Let's define a simple function

In [1]:
def f(n):
    return n + 5

We can now do the following:

In [2]:
g = f

This means that the variables g and f now refer to the same function. That means we can go:

In [3]:
g(10)
Out[3]:
15

Here is a generalization of this idea:

In [4]:
def applyit(func, arg):
    '''Return the value of func(arg)
    
    Arguments:
    func -- a function
    arg -- an object
    '''
    
    return func(arg)
In [5]:
applyit(f, 10)
Out[5]:
15

What happens is that f gets assigned to the local variable func, and 10 gets assigned to the local variable arg. We then obtain 15, as before.