#-------------------------------------------------------------
# first function is taken from lecture notes
#-------------------------------------------------------------
dna2dna = {'A':'T', 'T':'A', 'C':'G', 'G':'C'}
def reverse_complement(dna):
    """Return a string representing the reverse complement of the single dna strand."""
    other = ''              # start with an empty string
    for base in dna:
        other = other + dna2dna[base]
    return other[ : :-1]    # python trick to reverse a string


#-------------------------------------------------------------
# second function is your responsibility to implement
#-------------------------------------------------------------
def mutate(dna, motif):
    """Return the result of a mutation based on an inverted repeat of the given motif."""
    # your code here!
