def get_el_config(charge):
    """ Returns the electronic shell structure associated with a nuclear charge """

    # Electronic shells: 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d, 7p
    el_shell = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

    # Maximum number of electrons for each shell
    max_el = [2, 2, 6, 2, 6, 2, 10, 6, 2, 10, 6, 2, 14, 10, 6, 2, 14, 10, 6]

    # Set atomic charge as number of remaining electrons
    rest_electrons = charge

    # Start with first shell (1s)
    shell = 0

    # Until all electrons are depleted:
    while rest_electrons != 0:

        # Compare actual shell with maximum occupation number of current shell
        if el_shell[shell] != max_el[shell]:

            # If current shell is not full, add one electron and deplete it
            el_shell[shell] += 1
            rest_electrons -= 1

        else:  # If the shell is full go to the next one

            shell += 1

    # Return value(s) 
    return el_shell