[ create a new paste ] login | about

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

Python, pasted on Dec 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from string import*

def subStringMatchExact(target,key):
    return subStringMatchExactHelper(target, key, [], 0)

def subStringMatchExactHelper(target,key,z,x):
    ''' 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
        subStringMatchExactHelper(target,key,z,x)

print subStringMatchExact("SUCCESS","S")


Output:
1
None


Create a new paste based on this one


Comments: