human
Toggle the last m bits | function to toggle the last m bits.
calculating a number ' num ' having ' m ' bits and all are set ..
toggle the last m bits and return the number.
Driver code"
Solution in Python:

=====
Can you provide a code to toggle the last m bits and the other steps required?
assistant
#Here is code to toggle the last m bits and the other steps required.
 def toggleLastMBits ( n , m ) :
	num = ( 1 << m ) - 1
	return ( n ^ num )
n = 107
m = 4
print ( toggleLastMBits ( n , m ) )