human
Number of leading zeros in binary representation of a given number | Function to count the no . of leading zeros.
Keep shifting x by one until leftmost bit does not become 1..
Driver Code"
Solution in Python:
 Give me a code to number of leading zeros in binary representation of a given number and the other steps required?
assistant
#Here is code to number of leading zeros in binary representation of a given number and the other steps required.
 def countZeros ( x ) :
	total_bits = 32
	res = 0
	while ( ( x & ( 1 << ( total_bits - 1 ) ) ) == 0 ) :
		x = ( x << 1 )
		res += 1
	return res
x = 101
print ( countZeros ( x ) )