views:

69

answers:

0

Write the function subStringMatchExact. This function takes two arguments: a target string, and a key string. It should return a tuple of the starting points of matches of the key string in the target string, when indexing starts at 0. Complete the definition for

def subStringMatchExact(target,key):

For example,

subStringMatchExact("atgacatgcacaagtatgcat","atgc")

would return the tuple (5, 15).

Here are some test strings that you can use to test your function:

target1 = 'atgacatgcacaagtatgcat'
target2 = 'atgaatgcatggatgtaaatgcag'

And four key strings:

key10 = 'a'
key11 = 'atg'
key12 = 'atgc'
key13 = 'atgca'