Last active
August 29, 2015 14:16
-
-
Save yfe404/f042764091e9923e3fed to your computer and use it in GitHub Desktop.
A simple python program to transcript a DNA strand into a RNA one.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'. | |
Given a DNA string t corresponding to a coding strand, its transcribed RNA string u is formed by replacing all occurrences of 'T' in t with 'U' in u. | |
Given: A DNA string t having length at most 1000 nt. | |
Return: The transcribed RNA string of t. | |
""" | |
import os | |
imput_filepath = '/tmp/rosalind_rna.txt' | |
try: | |
with open(imput_filepath) as line: | |
dna = line.readline() | |
print(str(dna.replace('T', 'U'))) | |
except IOError as err: | |
print('File Error : ' + str(err)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment