Question: I need help debugging a PYTHON code and adding documentation. The input of the code should ask for a DNA sequence using the letters ACTG
I need help debugging a PYTHON code and adding documentation.
The input of the code should ask for a DNA sequence using the letters ACTG
The output should give you AT content in a decimal (# 0-1)
For example the input of sequence ATCGGCTA, should give you an output of:
AT content = 0.5
This is the error I get from the code above

class dnaString (str): def length (self): return (len(self)). def getAT (self): num_A = self.count(A) num_T = self.count("T") return ((num_A + num_T)/ self.len() ) dna = input("Enter a dna sequence: "). upperDNA = dna.upper() coolString = dnaString(upperDNA) print ("AT content = {0:0.1f}".format(coolString.getAT()) ) Enter a dna sequence: AAAATGAATGGCTAACTTTTGAA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NameError Traceback (most recent call last)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
