Question
Write a function has_kitty_gene(dna) in python that passes the following doctests. #RQ3 def has_kitty_gene(dna): Returns whether the linked list dna contains the CATCAT gene as
Write a function has_kitty_gene(dna) in python that passes the following doctests.
#RQ3 def has_kitty_gene(dna):
"""Returns whether the linked list dna contains the CATCAT gene as a sublist.
>>> dna = link('C', link('A', link('T'))) >>> dna = link('C', link('A', link('T', link('G', dna)))) >>> print_link(dna) C A T G C A T >>> has_kitty_gene(dna) False >>> end = link('T', link('C', link('A', link('T', link('G'))))) >>> dna = link('G', link('T', link('A', link('C', link('A', end))))) >>> print_link(dna) G T A C A T C A T G >>> has_kitty_gene(dna) True >>> has_kitty_gene(end) False """
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started