def evaluate_polynomial(p, x):
    """
    Evaluate the polynomial p at position x.

    Parameters
    ----------
    p : list
        Polynomial as a list of coefficients.
    x : number
        Where the polynomial gets evaluated.

    Returns
    -------
    number
    """
    y = 0
    xi = 1
    for i, a in enumerate(p):
        y += a * xi
        xi *= x
    return y