def _get_effective_charge(Z: int, n: int):
    """
    Calculates the approximate effective charge for an electron, using Slater's Rule of shielding.

    Args:
        Z: Nuclear charge of an atom
        n: Principal quantum number of the elctron for which the effective charge is being calculated

    Returns:
        Z_eff (float): effective charge
    """
    shielding = 0
    for n_shell in range(1, n+1):
        n_electrons_in_shell = 2 * n_shell ** 2
        if n_shell == n:
            n_el_in_lower_shells = sum([2*k**2 for k in range(1,n_shell)])
            n_electrons_in_shell = min(Z - n_el_in_lower_shells, n_electrons_in_shell) - 1

        if n_shell == n:
            shielding += n_electrons_in_shell * 0.35
        elif n_shell == (n-1):
            shielding += n_electrons_in_shell * 0.85
        else:
            shielding += n_electrons_in_shell
    return max(Z - shielding, 1)