Function to check palindrome
def isPalindrome ( s ) : NEW_LINE INDENT left = 0 NEW_LINE right = len ( s ) - 1 NEW_LINE while ( left <= right ) : NEW_LINE INDENT if ( s [ left ] != s [ right ] ) : NEW_LINE INDENT return False NEW_LINE DEDENT left = left + 1 NEW_LINE right = right - 1 NEW_LINE DEDENT return True NEW_LINE DEDENT