Jupyter Snippet CB2nd 07_high_quality

Jupyter Snippet CB2nd 07_high_quality

2.7. Writing high-quality Python code

def power(x, n):
    """Compute the power of a number.

    Arguments:
    * x: a number
    * n: the exponent

    Returns:
    * c: the number x to the power of n

    """
    return x ** n
# Imports
# -------
import numpy

# Utility functions
# -----------------

def fun():
    pass