Files
python/rna-transcription/example.py

17 lines
323 B
Python
Raw Normal View History

import sys
if sys.version_info[0] == 2:
from string import maketrans
else:
maketrans = str.maketrans
2014-02-22 10:55:33 +08:00
2013-07-30 09:01:03 -05:00
class DNA(object):
rna_translation = maketrans('AGCT', 'UCGA')
2013-07-30 09:01:03 -05:00
def __init__(self, strand):
self.strand = strand
def to_rna(self):
return self.strand.translate(self.rna_translation)