Traverse all bits , if bits are same , then XOR is 0 , else 1
for i in range ( 1 , len ( b ) ) : NEW_LINE INDENT if a [ i ] == b [ i ] : NEW_LINE INDENT result . append ( '0' ) NEW_LINE DEDENT else : NEW_LINE INDENT result . append ( '1' ) NEW_LINE DEDENT DEDENT return ' ' . join ( result ) NEW_LINE