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 (10/10)
All required files submitted!
1.1) test_palindrome_text_(test_A6.A6ProjectTest)(15/15)
1.2) test_palindrome_number (test_A6.A6ProjectTest)(15/15)
1.3) test_not_palindrome_text_(test_A6.A6ProjectTest)(0/15)
Test Failed: True is not false
1.4) test_not_palindrome_number (test_A6.A6ProjectTest)(15/15)
1.5) test_dna_nucleotide (test_A6.A6ProjectTest)(0/15)
Test Failed: name 'count_A' is not defined
1.6) test_dna_nucleotide_small_letter (test_A6.A6ProjectTest)(0/15)
Test Failed: name 'count_A' is not defined# 1) 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 is_palindrome(word):
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 , DNA_sequence_length, base_A_proportion,
# base_T_proportion, base_C_proportion and base_G_proportion.
def dna_nucleotide(text):
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 is_palindrome() function
# if is_palindrome(word):
# print(f"{word} is palindrome!")
# else:
# print(f"{word} is not palindrome!")
print()
txt = input(" Please enter a DNA sequence: ")
# uncomment the following lines to test your dna_nucleotide() function
# dna_length, base_A_prop, base_T_prop, base_C_prop, base_G_prop = dna_nucleotide(txt)
# print(f" DNA sequence length ={dna_length}")
# print(f" Base A proportion ={base_A_prop:.2f}%")
# print(f" Base T proportion ={base_T_prop:.2f}%")
# print(f" Base C proportion ={base_C_prop:.2f}%")
# print(f" Base G proportion ={base_G_prop:.2f}%")
if __name__=='__main__':
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 1: A palindrome is a word or number that reads the same backward or forward.
Example:
palindrome number: 121,252,16461,...
palindrome word: racecar, civic, madam, ...
Write a python function to check if a given string is palindrome or not. Your function is name is_palindrome (word). The function returns true if the given word is palindrome , false otherwise.
Problem 2 : 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 A(A%), percentage of T (T%,), percentage of C (C%) and percentage of G( G%).
The function name is dna_nucleotide (text) and it returns five values such as dna_length, base_A_proportion, base_T_proportion, base_C_proportion and base_G_proportion 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 (A,T,C and G) in DNA sequence.
Note that:
base_A_proportion(percentage of A )=(number of letter A in the text)/(total length of the text)
Similarly, you can compute for percentage of T , percentage of C and percentage of G.
can you rewrite the code: because Autograder

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 Accounting Questions!