Question: Please help me to edit my code in python and this is my code and I don't know why I cannot print the last one

Please help me to edit my code in python and this is my code and I don't know why I cannot print the last one like this

Please help me to edit my code in python and this is

dna = input("Enter a DNA string:") print("Length is {0}".format(len(dna))) gc = 0 for c in dna: if c=='G' or c == 'C': gc = gc+ 1 gcpercent = gc/len(dna) print("GC-content is {0}".format(gcpercent)) print("First G found at position ",dna.index("G")) print("First G found at position ",dna.index("C"))

10. Due Date: 21 February Reading: Think CS: Chapter 2 & Lab 2 Write a program that prompts the user for a DNA string, and then prints the length and GC-content (percent of the string that is G or C, written as a decimal), as well as the position (index) of the first G and the first C A sample run of your program should look like: Enter a DNA string: ACGCCCGGGATG Length is 12 GC-content is 0.75 First G found at position 2 First C found at position 1 And another sample run: Enter a DNA string: AAAAA Length is 5 GC-content is 0.0 First G found at position -1 First C found at position - 1 Hint: See Lab 2

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!