Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loops
#1
Hello, I am wondering if anyone can help with this question? I am pretty rubbish at coding, and it doesnt return anything so I'm not sure what is wrong, and not sure what method to use.

One of the tasks that bioinformaticians need to do is to detect protein-coding genes by looking for start and stop codons in the sequenced viral genomes. Write a Python function named 'start_present' in the following code cell that takes a single DNA sequence (string) as an argument and returns the Boolean value True if the sequence starts with 'ATG' and False if it does not.

def start_present(dna_seq1):
    #your code here
    raise NotImplementedError()

#my answer attempt 1

def start_present(dna_seq1):
if dna_seq1 == 'string':
        return True
    else:
        return False
raise NotImplementedError()

#my answer attempt 2

def start_present(dna_seq1):
if string in dna_seq1:
        return True
    else:
        return False
raise NotImplementedError()
buran write Nov-27-2020, 04:12 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Messages In This Thread
Loops - by Tink - Nov-27-2020, 01:42 PM
RE: Loops - by jefsummers - Nov-27-2020, 02:05 PM
RE: Loops - by MK_CodingSpace - Nov-27-2020, 02:16 PM
RE: Loops - by ndc85430 - Nov-27-2020, 03:10 PM
RE: Loops - by Tink - Nov-27-2020, 02:56 PM
RE: Loops - by perfringo - Nov-27-2020, 06:09 PM
RE: Loops - by buran - Nov-28-2020, 08:31 PM
RE: Loops - by jefsummers - Nov-29-2020, 03:24 PM
RE: Loops - by GirishaSJ - Dec-03-2020, 08:14 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020