def reverse_complement(seq):
    """Converts a nucleotide sequence to reverse complement.

    The base characters in the nucleotide string (A, C, G and T) are converted to the following: A <-> T and C <-> G. The
    combined uppercase string is returned.

    Parameters
    ----------
    seq : str
        A nucleotide sequence string.

    Returns
    -------
    str
        The reverse complemented nucleotide sequence.

    """
    reverse_complement_seq = []
    for i in seq.upper():
        if i == 'A':
            reverse_complement_seq.append('T')
        elif i == 'C':
            reverse_complement_seq.append('G')
        elif i == 'G':
            reverse_complement_seq.append('C')
        elif i == 'T':
            reverse_complement_seq.append('A')
    return ''.join(reverse_complement_seq)
