Question: can you rewrite the code: because Autograder Results Check submitted files ( 1 0 / 1 0 ) All required files submitted! 1 . 1
can you rewrite the code: because Autograder Results
Check submitted files
All required files submitted!
testpalindrometexttestAAProjectTest
testpalindromenumber testAAProjectTest
testnotpalindrometexttestAAProjectTest
Test Failed: True is not false
testnotpalindromenumber testAAProjectTest
testdnanucleotide testAAProjectTest
Test Failed: name 'countA is not defined
testdnanucleotidesmallletter testAAProjectTest
Test Failed: name 'countA is not defined# Write a function that checks whether a given word or number is palindrome or not
# and returns True if it is palindrome and False if it is not palindrome.
def ispalindromeword:
pass # remove this line and comment and replace it with the code needed for the main function.
# write a function that computes the length of a DNA sequence and the proportion of individual bases in the sequences
# Note that: the function must return the four values inorder of DNAsequencelength, baseAproportion,
# baseTproportion, baseCproportion and baseGproportion.
def dnanucleotidetext:
pass # remove this line and comment and replace it with the code needed for the main function.
def main:
word input Please enter a word :
# uncomment the following lines to test your ispalindrome function
# if ispalindromeword:
# printfword is palindrome!"
# else:
# printfword is not palindrome!"
print
txt input Please enter a DNA sequence:
# uncomment the following lines to test your dnanucleotide function
# dnalength, baseAprop, baseTprop, baseCprop, baseGprop dnanucleotidetxt
# printf DNA sequence length dnalength
# printf Base A proportion baseAprop:f
# printf Base T proportion baseTprop:f
# printf Base C proportion baseCprop:f
# printf Base G proportion baseGprop:f
if namemain:
main using Assignment Requirements
For this assignment, you need to commplete the following two problems as described below and based on the starter code
Problem : A palindrome is a word or number that reads the same backward or forward.
Example:
palindrome number:
palindrome word: racecar, civic, madam,
Write a python function to check if a given string is palindrome or not. Your function is name ispalindrome word The function returns true if the given word is palindrome false otherwise.
Problem : Given a DNA nucleotide seqences, for instance:
DNA"ATGCGCGGATCGTACCTAATCGATGGCATTAGCCGAGCCCGATTACGC"
Write a python program that computes the length of the sequence and the proportion of individual bases in the sequence. That is percentage of AA percentage of T T percentage of C C and percentage of G G
The function name is dnanucleotide text and it returns five values such as dnalength, baseAproportion, baseTproportion, baseCproportion and baseGproportion respectively. The text can be given in lower case or uppercase. Your code must work in both cases. Thus, consider converting the given text to upper case. There are only four bases ATC and G in DNA sequence.
Note that:
baseAproportionpercentage of A number of letter A in the texttotal length of the text
Similarly, you can compute for percentage of T percentage of C and percentage of G
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
