Closed vovs03 closed 1 year ago
def dna_to_rna(dna):
return
import codewars_test as test
from solution import dna_to_rna
@test.describe("Sample Tests")
def basic_tests():
@test.it('Basic Test Cases')
def basic_test_cases():
test.assert_equals(dna_to_rna("TTTT"), "UUUU")
test.assert_equals(dna_to_rna("GCAT"), "GCAU")
test.assert_equals(dna_to_rna("GACCGCCGCC"), "GACCGCCGCC")
# DNA.py
dna = "GACCTGCTCGTCCT"
def dna_to_rna(dna):
return print(dna.replace('T', 'U'))
dna_to_rna(dna)
DNA to RNA Conversion
Task
Deoxyribonucleic acid, DNA is the primary information storage molecule in biological systems. It is composed of four nucleic acid bases Guanine ('G'), Cytosine ('C'), Adenine ('A'), and Thymine ('T').
Ribonucleic acid, RNA, is the primary messenger molecule in cells. RNA differs slightly from DNA its chemical structure and contains no Thymine. In RNA Thymine is replaced by another nucleic acid Uracil ('U').
Create a function which translates a given DNA string into RNA.
For example:
""GCAT" => "GCA" The input string can be of arbitrary length - in particular, it may be empty. All input is guaranteed to be valid, i.e. each input string will only ever consist of 'G', 'C', 'A' and/or 'T'.
Ru- version
:a: Создайте функцию, которая преобразует заданную строку ДНК в РНК.
Например:
""GCAT" => "GCA" Входная строка может быть произвольной длины - в частности, она может быть пустой. Все входные данные гарантированно будут действительными, т.е. каждая строка ввода всегда будет состоять только из 'G', 'C', 'A' и /или 'T'.