# Codon                 | Protein
# :---                  | :---
# AUG                   | Methionine
# UUU, UUC              | Phenylalanine
# UUA, UUG              | Leucine
# UCU, UCC, UCA, UCG    | Serine
# UAU, UAC              | Tyrosine
# UGU, UGC              | Cysteine
# UGG                   | Tryptophan
# UAA, UAG, UGA         | STOP

CODON_TO_PROTEIN = {
    "AUG": "Methionine",
    "UUU": "Phenylalanine",
    "UUC": "Phenylalanine",
    "UUA": "Leucine",
    "UUG": "Leucine",
    "UCU": "Serine",
    "UCC": "Serine",
    "UCA": "Serine",
    "UCG": "Serine",
    "UAU": "Tyrosine",
    "UAC": "Tyrosine",
    "UGU": "Cysteine",
    "UGC": "Cysteine",
    "UGG": "Tryptophan"
}

STOP_CODONS = set({"UAA", "UAG", "UGA"})


def proteins(strand):
    if (strand in STOP_CODONS):
        return []
    return [CODON_TO_PROTEIN[strand]]

@@ -731,16 +731,33 @@
 %22UGA%22%7D)%0A
+CODON_LENGTH = 3%0A
 %0A%0Adef pr
@@ -780,18 +780,107 @@
     
-if (strand
+polypeptide = %5B%5D%0A    codons = split_into_codons(strand)%0A%0A    for codon in codons:%0A        if (codon
  in 
@@ -893,16 +893,20 @@
 ODONS):%0A
+    
         
@@ -916,45 +916,240 @@
 urn 
-%5B%5D%0A    return %5BCODON_TO_PROTEIN%5Bstrand%5D
+polypeptide%0A        else:%0A            polypeptide.append(CODON_TO_PROTEIN%5Bcodon%5D)%0A%0A    return polypeptide%0A%0A%0Adef split_into_codons(strand):%0A    return %5Bstrand%5Bi:i + CODON_LENGTH%5D for i in range(0, len(strand),%0A            CODON_LENGTH)
 %5D%0A

Solve protein translation