Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to write a python code. These are the instructions: Write a module, complement.py , with a function, complement, that returns the complement of
I need to write a python code. These are the instructions: "Write a module, complement.py with a function, complement, that returns the complement of a DNA string. Also provide a function, revComplement that takes a DNA sequence as string input and returns the reverse complement of the sequence as a string. Recall that the valid alphabet is A C T G and that AT and GC are complements. A reverse complement is found by reversing the input string and replacing every nucleotide with its complement. This means that your revComplement method should use your complement method internally rather than duplicating code. Your methods should do appropriate error checking and return an error message as appropriate. Test your functions with input from the user. For example, if your input is ACTG, your complement should be TGAC and your reverse complement should be CAGT." This is what I have so far but my understanding of functions is severely limited and this is not including the reverse complement function yet bc I was trying to just get the complement one done first: def complementdna: complementdna A:TC:GG:CT:A #convert to uppercase dna dna.upper bases listdna letters for x in bases: if x in complementdna: letters letters dnax return joinletters dna strinputEnter the DNA string: printThe complement iscomplementdna Of course, my code can be completely ignored if it is not on the right track what so ever. Any help would be appreciated!!You should not be using any built in modules that calculate variancestandard deviation
for you, you need to code this on your own.
In order to make your program as modular as possible, however, you should define your
own functions to carry out the computation. These functions should be:
sortedlist takes a list of integers as input and returns them in sorted order
computemean takes a list of integers as input and returns the mean average
of the list
computevariance takes a list of integers as input and returns the variance of
the list. Note that this method can call the computeMean method.
computestandarddev takes the variance as input and returns the standard
deviation just the square root of variance
Due Date
This assignment is due at :pm on Submit via Canvas; create a zip file with
all your files in it It should be labeled lastNameFirstInitialA Please make sure to include
all the required files README source files
Grading
Assignments will be graded on correctness according to the prompt, adherence to style,
and the inclusion of meaningful comments.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started