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.5I need help debugging a PYTHON code and adding documentation. The input

This is the error I get from the code above

of the code should ask for a DNA sequence using the letters

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) in 16 coolString = dnaString(upperDNA) 17 ---> 18 print ("AT content = {0:0.1f}".format(coolString.getAT() ) ) in getAT(self) ---> 9 10 11 12 def getAT (self): num A = self.count (A) num T = self.count("T") return ((num_A + num_T)/ self.len() ) NameError: name 'A' is not defined

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!