![]() |
Let’s discuss the DNA transcription problem in Python. First, let’s understand about the basics of DNA and RNA that are going to be used in this problem.
Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement nucleotide:
Example : Input: GCTAA Output: CGAUU Input: GC Output: CG Approach: Take input as a string and then convert it into the list of characters. Then traverse each character present in the list. check if the character is ‘G’ or ‘C’ or ‘T’ or ‘A’ then convert it into ‘C’,’G’, ‘A’ and ‘U’ respectively. Else print ‘Invalid Input’. Below is the implementation: Python3
Output: Translated DNA : CGAUU |
Reffered: https://www.geeksforgeeks.org
Python |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 8 |