def pal(word): isPal = 1 first = 0 last = len(word)-1; for x in range(last): if(word[first]!=word[last]): isPal = 0 first += 1 last -=1 return isPal