Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- target1 = 'atgacatgcacaagtatgcat'
- target2 = 'atgaatgcatggatgtaaatgcag'
- testtarget = 'atgaatgcatggatgtaaat'
- # key strings
- key10 = 'a'
- key11 = 'atg'
- key12 = 'atgc'
- key13 = 'atgca'
- def recursivematch(target,key,pos):
- '''Recursive Function to Print Out Index at Which Key is found.'''
- index = target.find(key,pos)
- keylen = len(key)
- if index == -1:
- print('Loop has ended')
- return None
- else:
- print('Index is {0}'.format(index))
- index += keylen
- return recursivematch(target,key,index)
- x = 0
- recursivematch(target2,key12,x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement