def get_num_iter(x, y, z=(0 + 0j), num_iter=0):
    """Determines whether abs(z) diverges and, if so, how many interations it
    takes for abs(z) to diverge

    Parameters:
    x - The x-coordinate (or real part) of point c
    y - The y-coordinate (or imaginary part) of point c
    z - Value that is recursively calculated by z_i+1 = z_i^2 + c (z_0 = 0)
    num_iter - current number of iterations of z (starts at 0)

    Returns:
    Number of iterations at which abs(z) diverges, that is, abs(z) > 10.
    If the number does not diverge, that is, after 50 iterations abs(z) <= 10,
    return 0
    """
    z_new = z**2 + x + y*1j

    if num_iter >= 50:
        return 0

    if abs(z_new) > 10:
        return num_iter

    return get_num_iter(x, y, z_new, num_iter + 1)