Im Stuck Writing Working Code Python Using Python Write Function Called Countcodons Dna Ta Q43888966
im stuck with writing a working code for those in python:
- Using python, how do I write a function called countCodons(DNA)which takes an input a DNA string (you may assume its length is amultiple of 3) and returns the number of codons in that string. Forexample, countCodons(“CATGGG”) returns 2.
I started with defcountCodon(DNA):
DNA= ‘ ‘
- Using python, how do you make a palindrome is a string that isthe same forwards as backwards. For example “radar”, “wow”, and”abba” are all palindromes. Write a function calledpalindrome4(input) that takes a string of length exactly 4 as inputand returns the Boolean True if that string is a palindrome andreturns the Boolean False otherwise. If the string has length lessthan or greater than 4, the function should also return False.Here’s an example of the function in action:
- A DNA string is called an open reading frame (ORF) if it beginswith ‘ATG’, ends with ‘TGA’, ‘TAG’, or ‘TAA’, and has a length thatis a multiple of ORFs are interesting because they can encodeproteins. Write a function called ORFadviser(DNA) that takes astring called DNA as input and works as follows: you can start withdef ORFadviser(DNA):
The function returns the string ‘Thisis an ORF’ if the input string satisfies all three of theconditions required of ORFs.Otherwise, if the first three symbolsare not ‘ATG’, the function returns the string ‘The first threebases are not ATG’. Otherwise, if the string does not end with’TGA’, ‘TAG’, or ‘TAA’, the function returns the string ‘The lastthree bases are not a stop codon’.
Otherwise, the function returns thestring ‘The string is not of the correct length.’
- Write a function called friendly(greeting) that takes a stringnamed greeting as input. If the greeting begins with the words’Hello’ or ‘Hi’, the function returns some friendly greeting stringof your choice. Otherwise, if the greeting string ends with aquestion mark, the function returns the string ‘Good question!’.Otherwise, the function returns with some string indicating that itdidn’t understand the greeting (e.g., ‘I am sorry, but I did notunderstand you.’).
- Lastly, how do you write a simpler code in python to calculategcContent of any length of DNA string using for LOOP. You can callyour function gcContent(DNA).
- Here are some examples of gcContent(DNA) that work:
>>> gcContent(“ACCGC”)
0.8
>>> gcContent(“ATACTAAA”)
0.125
Expert Answer
Answer to im stuck with writing a working code for those in python: Using python, how do I write a function called countCodons(DNA…
OR