def reverse_and_complement(s):
    """Takes an RNA sequence and returns the reversed and complemented form.
    Presumably `s` is formed by transcribing a DNA sequence.  If the same DNA
    sequence was transcribed in the opposite direction, you would get the RNA
    sequence that this function returns.
    """
    rna_list = list(s)
    rna_list.reverse()
    rev_c = []
    complement = {'A' : 'U', 'C' : 'G', 'G': 'C', 'U': 'A'}
    for i in rna_list:
        rev_c.append(complement[i])
    return ''.join(rev_c)