[ create a new paste ] login | about

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

Python, pasted on Dec 16:
1
2
3
4
5
6
7
8
9
10
11
12
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:
        return tuple(z)
    if find(target,key,x)!= -1:
        z.append(find(target,key,x))
        x = find(target,key,x)+1
        subStringMatchExact(target,key,z,x)

print subStringMatchExact("SUCCESS","S")


Output:
1
None


Create a new paste based on this one


Comments: