human
Program to find whether a no is power of two | Function to check if x is power of 2.
Driver code"
How can the above be solved in Python?

=====
Write me a code to program to find whether a no is power of two and the other steps required?
assistant
#Here is code to program to find whether a no is power of two and the other steps required.
 def isPowerOfTwo ( n ) :
	if ( n == 0 ) :
		return False
	while ( n != 1 ) :
		if ( n % 2 != 0 ) :
			return False
		n = n // 2
	return True
if ( isPowerOfTwo ( 31 ) ) :
	print ( ' Yes ' )
else :
	print ( ' No ' )
if ( isPowerOfTwo ( 64 ) ) :
	print ( ' Yes ' )
else :
	print ( ' No ' )