NZEC Error: Python

def main():

n = int(raw_input())
initList = []
tempMax = 0
	
for i in range (0,n):
	initList.append(raw_input())

initList.sort()

i = 0
for i in range (0,n-1):
	l0 = len(initList[i])
	l1 = len(initList[i+1])
	k = 0
	while (initList[i][k]==initList[i+1][k] and k<l0 and k<l1):
		k+=1
	if (k>tempMax):
			tempMax = k
print(tempMax)

return 0;

main()

Well…
I tried everything…
removing the main() and running the code in Body also, still getting NZEC error.
Please someone help me

there is no need return 0 for python!

then do you have any idea about NZEC error then

Got it…
little problem with the code only

what was the problem, please share

the problem here is you have to check the boundary of the 2 strings before trying to access the k-th character.

while (k<l0 and k<l1 and initList[i][k]==initList[i+1][k]):

instead of :

while (initList[i][k]==initList[i+1][k] and k<l0 and k<l1):

should be ok.

So that results in RUNTIME error, I seriously doubt my understanding of python or may be runtime error. Enlighten me please!

//