human
XOR two binary strings of unequal lengths | Function to insert n 0 s in the beginning of the given string.
Function to return the XOR of the given strings.
Lengths of the given strings.
Make both the strings of equal lengths by inserting 0 s in the beginning.
Updated length.
To store the resultant XOR.
Driver code"
How can the above be solved in Python?
 Can you provide a code to xOR two binary strings of unequal lengths and the other steps required?
assistant
#Here is code to xOR two binary strings of unequal lengths and the other steps required.
 def addZeros ( strr , n ) :
	for i in range ( n ) :
		strr = "0" + strr
	return strr
def getXOR ( a , b ) :
	aLen = len ( a )
	bLen = len ( b )
	if ( aLen > bLen ) :
		b = addZeros ( b , aLen - bLen )
	elif ( bLen > aLen ) :
		a = addZeros ( a , bLen - aLen )
	lenn = max ( aLen , bLen ) ;
	res = " "
	for i in range ( lenn ) :
		if ( a [ i ] == b [ i ] ) :
			res += "0"
		else :
			res += "1"
	return res
a = "11001"
b = "111111"
print ( getXOR ( a , b ) )