def find_stop(dna):
    """
    Finds the location of the stop codon.
    dna: a dna sequence
    returns: the location of the first letter of the stop codon
    >>> find_stop("ATGTGAA")
    3
    >>> find_stop("ATGTGAATGA")
    3
    >>> find_stop("ATAAAA")
    -1
    """
    #try/except
    for i in range(len(dna)):
        codon = dna[i:i+3]
        if codon == 'TAG' and i%3 == 0: #if it's in the frame and is a stop codon
            return i # tell us where it is
        elif codon == 'TAA' and i%3 == 0: # same
            return i
        elif codon == 'TGA' and i%3 == 0: #same
            return i

    return -1