human
Highest power of 2 that divides a number represented in binary | Function to return the highest power of 2 which divides the given binary number.
To store the highest required power of 2.
Counting number of consecutive zeros from the end in the given binary string.
Driver code"
How can the above be solved in Python?

Give me a code to highest power of 2 that divides a number represented in binary and the other steps required?
assistant
#Here is code to highest power of 2 that divides a number represented in binary and the other steps required.
 def highestPower ( str , length ) :
	ans = 0 ;
	for i in range ( length - 1 , - 1 , - 1 ) :
		if ( str [ i ] == '0' ) :
			ans += 1 ;
		else :
			break ;
	return ans ;
def main ( ) :
	str = "100100" ;
	length = len ( str ) ;
	print ( highestPower ( str , length ) ) ;
if __name__ == ' _ _ main _ _ ' :
	main ( )