Question: Write and test a Python function common _ pair, that checks whether any two consecutive characters of left match any two consecutive characters in right.
Write and test a Python function commonpair, that checks whether any two consecutive characters of left match any two consecutive characters in right. The function should return the first two matching characters it finds or the empty string if there is no match.
Complete the function in the following cell. We have provided some tests; your tutor may use additional tests.
run i mutil
def commonpairleft: str right: str str:
pass # Delete this and replace with your answer here
commonpairtests
# case, left, right, common pair
one is empty', 'ACTG',
same string', 'ACTG', 'ACTG', AC
nothing common', 'ACCA', GTGT
subsequence 'AAAA', 'GATTA',
testcommonpair, commonpairtests
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
