I have already converted user input of DNA code (A,T,G,C) into RNA code(A,U,G,C). This was fairly easy
(A,T,G,C)
(A,U,G,C)
RNA_Code=DNA_Code.replace(\'
You can use a mapping dictionary:
In [1]: dic={"A":"U","U":"A","G":"C","C":"G"} In [2]: strs="AUUUGCGGCAAA" In [3]: "".join(dic[x] for x in strs) Out[3]: 'UAAACGCCGUUU'