Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the "instructions" for the development and functioning of living organisms.

If you want to know more http://en.wikipedia.org/wiki/DNA

In DNA strings, symbols "A" and "T" are complements of each other, as "C" and "G". 
You have function with one side of the DNA (string, except for Haskell); you need to get the other complementary side. DNA strand is never empty or there is no DNA at all (again, except for Haskell).

More similar exercise are found here http://rosalind.info/problems/list-view/ (source)

```python
DNA_strand ("ATTGC") # return "TAACG"

DNA_strand ("GTAT") # return "CATA"
```

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def DNA_strand(dna):
	

Solutions:
def DNA_strand(dna):
	pairs = [('A', 'T'), ('C', 'G')]
	replacing_rules = pairs_to_dict(pairs)
	return ''.join(list([replacing_rules[a] for a in dna]))

def pairs_to_dict(pairs):
	d = {}
	for pair in pairs:
		d[pair[0]] = pair[1]
		d[pair[1]] = pair[0]
	return d


pairs = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}

def DNA_strand(dna):
	return ''.join([pairs[x] for x in dna])


def DNA_strand(dna):
	dnaComplement = ''
	for string in dna:
		if string == 'A':
			dnaComplement += 'T'
		elif string == 'T':
			dnaComplement += 'A'
		elif string == 'G':
			dnaComplement += 'C'
		elif string == 'C':
			dnaComplement += 'G'
	return dnaComplement


def DNA_strand(dna):
	return ''.join([{'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}[l] for l in dna])


def DNA_strand(dna):
	return dna.translate(dna.maketrans('ATCG', 'TAGC'))


def DNA_strand(dna):
	return ''.join([{'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G'}[letter] for letter in dna])