
# Functions are first class

def apply_to_one(f):
    """calls the function f with 1 as its argument"""
    return f(1)

def double(x):
    """this is where you put an optional docstring
    that explains what the function does.
    for example, this function multiplies its input by 2"""
    return x * 2

# double is a function name (constant !!!)
# my_double is a VARIABLE !!!

my_double = double      # You can assign a function to a variable

x = apply_to_one(my_double) # You can pass a function
print(x)
