human
Check divisibility of binary string by 2 ^ k | function to check whether given binary number is evenly divisible by 2 ^ k or not.
count of number of 0 from last.
if count = k , number is evenly divisible , so returns true else false.
first example.
Second example"
How can the above be solved in Python?
assistant
#Here is code to check divisibility of binary string by 2 ^ k and the other steps required.
 def isDivisible ( str , k ) :
	n = len ( str )
	c = 0
	for i in range ( 0 , k ) :
		if ( str [ n - i - 1 ] == '0' ) :
			c += 1
	return ( c == k )
str1 = "10101100"
k = 2
if ( isDivisible ( str1 , k ) ) :
	print ( " Yes " )
else :
	print ( " No " )
str2 = "111010100"
k = 2
if ( isDivisible ( str2 , k ) ) :
	print ( " Yes " )
else :
	print ( " No " )