human
Give me a code to check if mirror image of a number is same if displayed in seven segment display and the other steps required given the following:
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"
Solution in Python:
assistant
#Here is code to check if mirror image of a number is same if displayed in seven segment display and the other steps required.
 def checkEqual ( S ) :
	for i in range ( len ( S ) ) :
		if ( S [ i ] != '1' and S [ i ] != '0' and S [ i ] != '8' ) :
			return " No " ;
	start = 0 ;
	end = len ( S ) - 1 ;
	while ( start < end ) :
		if ( S [ start ] != S [ end ] ) :
			return " No " ;
		start += 1 ;
		end -= 1 ;
	return " Yes " ;
S = "101" ;
print ( checkEqual ( S ) ) ;