Question
Python!! I am trying to find a stop codon within a string of DNA 1.) run down the string If there is no stop codon
Python!!
I am trying to find a stop codon within a string of DNA
1.) run down the string
If there is no stop codon return "no stop"
if there is a codon return the index of the first letter of the codon
(stop codons are ATG, TAA, and TAG)
This is my code so far but I doesnt print anything:
def stopping():
myDNA = input("Enter a string of DNA: ")
for j in myDNA:
j = 0
thisCodon = myDNA[j: j+3]
stop = ((thisCodon == 'TAA') or (thisCodon == 'TAG') or (thisCodon == 'TGA'))
while j <= j-3 and not stop:
hasStop = False
j = j + 1
print("-1")
if thisCodon == stop:
hasStop = True
return myDNA[j]
Run these two strands through the code:
TTTAAAGGGAAA (no stop codon)
TTTAAATAGGGG (stop codon at index 6]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started