sorry,the code was as follows:
count=int(raw_input())
for i in xrange(count):
num=raw_input()
print palindrome(num)
it was time limit exceeded ,so i thought that changing it with apply() maybe improve the program .
but i misused the function without mind.