nzec runtime error in python-Collection of common programming errors
This code works fine in my system. However, when i ran in in an online compiler+ debugger, it gave me a runtime(NZEC) error saying indentation in line4:if a.index(min(a)) is wrong. The solution I expect is that the outermost for loop needs to run ‘t’ times. According to that my code has to be right. Please help me find the mistake. Also, if you can tell me when all will we get an NZEC error, it will help me a lot! Thanks in advance!
t = int(raw_input())
for i in range(t):
a = map(int, raw_input())
if a.index(min(a)) != 0:
if min(a) == 0:
print a.index(min(a))
else:
print str(str(a.index(min(a))) * (min(a)+1))
elif a.index(min(a)) == 0:
k = min(a)
a[0] = 99
l = min(a)
if l == k:
print str(str(a.index(min(a))) * min(a))
elif l > k:
print '1'+ ('0' * (k+1))