<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def flipGenotype(genotype):
 """Flips a genotype. :param genotype: the genotype to flip. :type genotype: set :returns: the new flipped genotype (as a :py:class:`set`) .. testsetup:: from pyGenClean.DupSNPs.duplicated_snps import flipGenotype .. doctest:: set(['A', 'T']) set(['A', 'G']) set(['A', 'C']) Traceback (most recent call last):
 ProgramError: 0: unkown allele Traceback (most recent call last):
 ProgramError: N: unkown allele """

    newGenotype = set()
    for allele in genotype:
        if allele == "A":
            newGenotype.add("T")
        elif allele == "C":
            newGenotype.add("G")
        elif allele == "T":
            newGenotype.add("A")
        elif allele == "G":
            newGenotype.add("C")
        else:
            msg = "%(allele)s: unknown allele" % locals()
            raise ProgramError(msg)

    return newGenotype