#
At least encapsulate
2
A function

def
mySplite

(strInfo, splitStr):

strList = []

i =

0


while

i <

len

(strInfo):

index = strInfo.

find

(splitStr)

if

index ! = –

1

:

temp = strInfo[i:(index):]

if

temp ! =

“”

:

strList.

append

(temp)

strInfo = strInfo[(index +

1

) : :]

i =

0


else

:

if

strInfo ! =

“”

:

strList.

append

(strInfo)

break



return

strList





def
main

() :

strInfo =

input

(

Enter a string of arbitrary length
:”

)

splitStr =

input

(

separator
:”

)

strList =

mySplite

(strInfo, splitStr)

print

(strList)





if

__name__ ==

‘__main__’

:

main

(a)



For more free technical information: annalin1203