[ create a new paste ] login | about

Link: http://codepad.org/a16aYuG1    [ raw code | output | fork ]

Python, pasted on Dec 16:
1
2
3
4
5
6
7
8
9
10
11
from string import*

def subStringMatchExact(target,key,z=[],x=0):
    ''' Where z begins as an empty set, to become the output tuple and x starts at 0 to hold the beginning search'''
    if find(target,key,x)!= -1:
        z.append(find(target,key,x))
        x = find(target,key,x)+1
        subStringMatchExact(target,key,z,x)
    return tuple(z)

print subStringMatchExact("SUCCESS","S")


Output:
1
(0, 5, 6)


Create a new paste based on this one


Comments: