# first function is taken from lecture notes
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:
        if base == 'G':
            other += 'C'
        elif base == 'C':
            other += 'G'
        elif base == 'A':
            other += 'T'
        else:               # presumably, only other possibility is T
            other += 'A'
    return other[ : :-1]    # reverse the result



# 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!
