Check if mirror image of a number is same if displayed in seven segment display | Return " Yes " , if the mirror image of number is same as the given number Else return " No " ; Checking if the number contain only 0 , 1 , 8. ; Checking if the number is palindrome or not . ; If corresponding index is not equal . ; Driver Code
def checkEqual ( S ) : NEW_LINE INDENT for i in range ( len ( S ) ) : NEW_LINE INDENT if ( S [ i ] != '1' and S [ i ] != '0' and S [ i ] != '8' ) : NEW_LINE INDENT return " No " ; NEW_LINE DEDENT DEDENT start = 0 ; NEW_LINE end = len ( S ) - 1 ; NEW_LINE while ( start < end ) : NEW_LINE INDENT if ( S [ start ] != S [ end ] ) : NEW_LINE INDENT return " No " ; NEW_LINE DEDENT start += 1 ; NEW_LINE end -= 1 ; NEW_LINE DEDENT return " Yes " ; NEW_LINE DEDENT S = "101" ; NEW_LINE print ( checkEqual ( S ) ) ; NEW_LINE