human
I am working on the file "02-basics/07-functions.ipynb".
The first task is:
6 [1] Decorating functions
Extending the behavior of functions that we don't want (or cannot) to modify:
Can you write Python code for it?
 ... Write me a the Python code you requested?
assistant
#Here is the Python code you requested.

def divide(numerator, denominator):
    return numerator/denominator

def safe_division(function):
    def wrapper(numerator, denominator):
        if denominator != 0:
            return function(numerator, denominator)
    return wrapper

# Function "decoration".
divide = safe_division(divide)

print(divide(1,2))
print(divide(1,0))

None == 0