Check if a number is a Mystery Number | Finds reverse of given num x . ; if found print the pair , return
def reverseNum ( x ) : NEW_LINE INDENT s = str ( x ) NEW_LINE s = s [ : : - 1 ] NEW_LINE return int ( s ) NEW_LINE DEDENT def isMysteryNumber ( n ) : NEW_LINE INDENT for i in range ( 1 , n // 2 + 1 ) : NEW_LINE INDENT j = reverseNum ( i ) NEW_LINE if i + j == n : NEW_LINE INDENT print ( i , j ) NEW_LINE return True NEW_LINE DEDENT DEDENT print ( " Not ▁ a ▁ Mystery ▁ Number " ) NEW_LINE return False NEW_LINE DEDENT n = 121 NEW_LINE isMysteryNumber ( n ) NEW_LINE