In genetic the reverse complement of a sequence is formed by **reversing** the sequence and then taking the complement of each symbol.

The four nucleotides in DNA is Adenine (A), Cytosine (C), Guanine (G) and Thymine (Thymine). 

- A is the complement of T 
- C is the complement of G.

This is a bi-directional relation so:

- T is the complement of A
- G is the complement of C.

For this kata you need to complete the reverse complement function that take a DNA string and return the reverse complement string.

**Note**: You need to take care of lower and upper case. And if a sequence conatains some invalid characters you need to return "Invalid sequence".

This kata is based on the following [one](http://www.codewars.com/kata/complementary-dna/ruby) but with a little step in addition.

Source: codewars | Difficulty: EASY

Starter code: def reverse_complement(dna):
	

Solutions:
get = dict(zip('ATCG', 'TAGC')).__getitem__

def reverse_complement(dna):
	try:
		return ''.join(map(get, reversed(dna)))
	except KeyError:
		return 'Invalid sequence'


def reverse_complement(dna):
	table = str.maketrans('ACGT', 'TGCA')
	return 'Invalid sequence' if set(dna) - set('ACGT') else dna.translate(table)[::-1]


def reverse_complement(dna):
	base_pair = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
	return ''.join((base_pair[base] for base in dna[::-1].upper())) if set(dna.upper()).issubset({'A', 'T', 'C', 'G', ''}) else 'Invalid sequence'


def reverse_complement(dna):
	reverse = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
	r_c = ''
	for nucl in reversed(dna):
		if nucl not in reverse:
			return 'Invalid sequence'
		else:
			r_c += reverse[nucl]
	return r_c


reverse_complement = lambda s, d='ACGT': s.translate(str.maketrans(d, 'TGCA'))[::-1] if set(s) <= set(d) else 'Invalid sequence'


def reverse_complement(dna):
	dna = dna[::-1]
	table = dna.maketrans('ATCG', 'TAGC')
	symbols = 'ACTG'
	for i in dna:
		if i not in symbols:
			return 'Invalid sequence'
	return dna.translate(table)