python: def dna_slice(strand, first_nucleotides, last_nucleotides):     """     Question 3 - Regex     You are working with a long strand of DNA. Your task is to find and return the length of the first substrand     that begins with the two-letter sequence specified in first_nucleotides and ends with the sequence specified in last_nucleotides.     THIS MUST BE DONE IN ONE LINE.     Args:     strand (str)     first_nucleotides (str)     last_nucleotides (str)     Returns:     int     strand_1 = 'TATGGGTCGAGCATGT'     >>> dna_slice(strand_1, 'AT', 'CG')     8     >>> dna_slice(strand_1, 'GT', 'TG')     10     """  strand_1 = 'TATGGGTCGAGCATGT'  pprint(dna_slice(strand_1, 'AT', 'CG'))  pprint(dna_slice(strand_1, 'GT', 'TG'))

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 15SA
icon
Related questions
Question

python:

def dna_slice(strand, first_nucleotides, last_nucleotides):
    """
    Question 3 - Regex

    You are working with a long strand of DNA. Your task is to find and return the length of the first substrand
    that begins with the two-letter sequence specified in first_nucleotides and ends with the sequence specified in last_nucleotides.

    THIS MUST BE DONE IN ONE LINE.

    Args:
    strand (str)
    first_nucleotides (str)
    last_nucleotides (str)

    Returns:
    int

    strand_1 = 'TATGGGTCGAGCATGT'
    >>> dna_slice(strand_1, 'AT', 'CG')
    8

    >>> dna_slice(strand_1, 'GT', 'TG')
    10

    """

 strand_1 = 'TATGGGTCGAGCATGT'
 pprint(dna_slice(strand_1, 'AT', 'CG'))
 pprint(dna_slice(strand_1, 'GT', 'TG'))

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning