Question: Please solve in python! Reverse complements First, write a function called reverse(s) that takes in the string s and returns a string that is the
Reverse complements First, write a function called reverse(s) that takes in the string s and returns a string that is the reverse of s. Please use a for loop here, and do not use the built-in syntax s[:-1] (which is another way to reverse string). Here's an example of your reverse function in action > reverse("spam") maps In your for loop you can loop either over the characters of the input or over the indices. Both ways will work. Next, write a function reversecomplement (DNA) that takes a DNA string as input (in 5' to 3' order) and returns the sequence of its complementary DNA strand, also in 5' to 3' order. This is called the reverse complement. This function will call both your reverse function and your compBase function for help. Here's an example > reverseComplement( "TTGAC) GTCAA
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
