def remove_previous_and_next_aa(peptide: str):
    """
    If the peptide has previous and next amino acids (e.g. A.AKLNCNAA.K) they get removed (e.g. returns AKLNCNAA)
    :param peptide: A string representing one peptide
    :return:
    """
    if peptide[1] == '.':
        peptide = peptide[2:]
    if peptide[-2] == '.':
        peptide = peptide[:-2]
    return peptide