Check if str [ 0. . i ] is palindrome using simple character by character match
for j in xrange ( 0 , i / 2 ) : NEW_LINE INDENT if string [ j ] != string [ i - j ] : NEW_LINE INDENT break NEW_LINE DEDENT DEDENT j += 1 NEW_LINE if j == i / 2 : NEW_LINE INDENT print string [ i ] + " ▁ Yes " NEW_LINE DEDENT else : NEW_LINE INDENT print string [ i ] + " ▁ No " NEW_LINE DEDENT else : NEW_LINE print string [ i ] + " ▁ No " NEW_LINE