Guest User

Untitled

a guest
Jun 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. def subStringMatchExact(target,key):
  2. bookmark=0
  3. location=()
  4. #While the find function does not fail to find a value
  5. while bookmark!=-1:
  6. #Store the index of the first match in bookbark.
  7. bookmark=find(target,key,bookmark)
  8. #Add bookmark to a tuple
  9. location=location+(bookmark,)
  10. #Find the next value of bookmark here so that if it is -1 we can stop before looping again.
  11. bookmark=find(target,key,bookmark+1)
  12. return location
  13.  
  14. def constrainedMatchPair(firstMatch,secondMatch,length):
  15. listmatch=()
  16. for n in range(0,len(firstMatch)):
  17. for k in range(0,len(secondMatch)):
  18. if firstMatch[n]+length+1==secondMatch[k]:
  19. listmatch=listmatch+(firstMatch[n],)
  20. return listmatch
Add Comment
Please, Sign In to add comment