Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def subStringMatchExact(target,key):
- bookmark=0
- location=()
- #While the find function does not fail to find a value
- while bookmark!=-1:
- #Store the index of the first match in bookbark.
- bookmark=find(target,key,bookmark)
- #Add bookmark to a tuple
- location=location+(bookmark,)
- #Find the next value of bookmark here so that if it is -1 we can stop before looping again.
- bookmark=find(target,key,bookmark+1)
- return location
- def constrainedMatchPair(firstMatch,secondMatch,length):
- listmatch=()
- for n in range(0,len(firstMatch)):
- for k in range(0,len(secondMatch)):
- if firstMatch[n]+length+1==secondMatch[k]:
- listmatch=listmatch+(firstMatch[n],)
- return listmatch
Add Comment
Please, Sign In to add comment