Lesson 6 of 15

Transcription

DNA → RNA

Genes are not directly read to make proteins. First, the DNA is copied into messenger RNA (mRNA) in a process called transcription.

RNA uses the same four-letter alphabet as DNA, with one change: Thymine (T) is replaced by Uracil (U).

DNA baseRNA base
AA
TU
GG
CC
def transcribe(dna):
    return dna.replace("T", "U")

print(transcribe("ATGCGATAA"))  # AUGCGAUAA
print(transcribe("ATCG"))       # AUCG

The resulting mRNA sequence is then exported from the nucleus and used as a template to build a protein. AlphaGenome predicts RNA production levels (expression) for thousands of genes across different tissues — liver, brain, heart, and more — from the DNA sequence alone.

Your Task

Implement transcribe(dna) that converts a DNA sequence to its RNA equivalent.

Python runtime loading...
Loading...
Click "Run" to execute your code.