Question: Can you tell how to write code function of proportion_gc (on atom) so that when we enter a dna, we get the proportion of g
Can you tell how to write code function of proportion_gc (on atom) so that when we enter a dna, we get the proportion of g and c. Also when we enter empty string on atom, we get 0.0 instead of error. 

# -- your proportion_gc function starts here 9 10 11 12 13 14 15 16 your function ends here -- 17 18 # -- edit the main() function below as described def main(): # ask the user to input a DNA string dna = input('Enter your DNA sequence:') 19 20 21 22 23 24 25 26 27 28 # call the proportion_gc function and store the value it returns # print the returned value using this output format: # The gc content is 0.1 29 30 31 32 33 34 35 # Don't change this part, it calls the main() function from above if _name_ _main_': main() Level 1 Challenge (required): is to write a function that computes the proportion of GC in a dna string. The function's name is proportion_gc. Similar to wlal, inside the function you will: . . count the total number of G and C in the dna string use the GC count from the first step and compute the decimal proportion of GC in the dna string To get this to work, your function needs to a return value, and your script needs to call the function and store the returned value. The file is already set up to print the stored value. The example inputs and desired outputs are the same as wlal. IN ACTG OUT 0.5 IN ATGATTAAAT OUT 0.1 IN aCctgGGC 0.75 OUT Level 2 Challenge (required): How will your function behave if a user enters an empty string? This is an "edge case" where the input is possible, but not likely. Your script shouldn't quit with errors when a user enters an empty string. Instead of an error, have it return a 0.0 IN (an empty string) OUT 0.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
