If current characters at both ends are not fancy pairs
if ( num [ l ] not in fp or fp [ num [ l ] ] != num [ r ] ) : NEW_LINE INDENT return False NEW_LINE DEDENT l += 1 NEW_LINE r -= 1 NEW_LINE return True NEW_LINE