I'm trying to check if a number is a palindrome or not. To do that I'm counting the number of times the kth element is equal to the (n-k)th element. If that number is equal to the length of the string , then it is a palindrome. I do get correct output for palindromes but absolutely no output(k) when the number is not a palindrome. Code for reference :
T = int(raw_input())
L = []
for i in range(0,T):
alpha = int(raw_input())
L.append(alpha)
print L
for i in range(0,len(L)):
L[i] = str(L[i])
print L
for i in range(0,len(L)):
k = 0
while k < len(L[i]) :
if L[i][k] == L[i][len(L[i])-(k)-1]:
k = k + 1
print k