题目描述
Problem
An RNA string is a string formed from the alphabet containing ‘A’, ‘C’, ‘G’, and ‘U’.
Given a DNA string s corresponding to a coding strand, its transcribed RNA string is formed by replacing all occurrences of ‘T’ in s with ‘U’ in s.
Given: A DNA string s having length at most 1000 nt.
Return: The transcribed RNA string of s.
Sample Dataset
GATGGAACTTGACTACGTAAATT
Sample Output
GAUGGAACUUGACUACGUAAAUU
题目大意
将给定的DNA序列转化为RNA序列
说白了就是把T换成U
题解
使用string.replace()方法
参考代码
with open("rosalind_rna.txt", "r") as f:
s = f.read()
print(s.replace("T", "U"))