human
Smallest power of 2 greater than or equal to n | .
First n in the below condition is for the case where n is 0.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to smallest power of 2 greater than or equal to n and the other steps required.
 def nextPowerOf2 ( n ) :
	count = 0 ;
	if ( n and not ( n & ( n - 1 ) ) ) :
		return n
	while ( n != 0 ) :
		n >>= 1
		count += 1
	return 1 << count ;
n = 0
print ( nextPowerOf2 ( n ) )