NZEC error in K2

This code gives NZEC error but works fine on my system.

import string

import sys

def int2base(integer,base):
if not integer: return ‘0’
alphanum = string.digits + string.ascii_lowercase
nums = alphanum[:base]
res = ‘’
while integer:
integer, mod = divmod(integer,base)
res += nums[mod]
return res[::-1]

inp = map(int,raw_input().split())[0]
while inp != 0:
if inp == 0:
sys.exit()
cases = map(int,raw_input().split())[0]
for x in range(2,300):
stri = int2base(int(cases),x)
if stri == stri[::-1]:
break
print x
inp -= 1

//