Question: We will complete this program that requires the definition of a function named computeGCRatio to compute the GC content of a DNA molecule. Given a

We will complete this program that requires the definition of a function named computeGCRatio to
compute the GC content of a DNA molecule.
Given a single string as input where each character is one of G, C, T or A, the GC ratio is computed as the
count of G+C values over the total count of A,T,C,G values. It is often written in texts as the following,
where each letter represents the count of instances in the string:
G+CA+T+G+C
Plan:
What would be the input value (parameter) needed for your function to use?
What is the name of your function?
What does the function return?
How do you compute then return the ratio value?
# Lab 8
# PUT YOUR DEFINITION OF THE FUNCTION computeGCRatio HERE!
# Hint: your function will need 4 counter variables ( one for each
# letter. And you will need to write a loop that steps through each
# character in the string
def computeGCRatio( # what is/are the parameters needed here?
# complete the logic here
# Main program to test the calculation
dnaFragment = input ("Enter the DNz sequence: ")
gcratio = computeGCRatio(dnaFragment) # to test your function
print ("For the sequence:", dnaFragment)
print ("The GC-Ratio is {:6.3f}". format (gcratio)
Some example data you can use to check if your
computation is correct:
(0.462)
 We will complete this program that requires the definition of a

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!