I keep getting NZEC error when i submit this code..can any one help me out ?
#!/usr/bin/python
def polyeval(val,coeff,n):
ans=long(0)
for i in range(0,n+1):
ans=coeff[i]+val*ans;
return ans
def solve(num,m):
ans=long(0)
while(num and m):
t=num%10
ans+=(t*t)
num/=10
m-=1
return ans
data=raw_input()
data=data.split()
n=long(data[0]) ; l=long(data[1]) ; k=long(data[2]) ; m=long(data[3]) # splitting the data
coeff=[0]*100
for i in range(0,n+1):
coeff[i]=long(input())
for i in range(l,l+k):
print solve(polyeval(i,coeff,n),m)
Thank you