human
Find whether a given number is a power of 4 or not | Function to check if x is power of 4.
Driver code"
Solution in Python:
 Can you provide a code to find whether a given number is a power of 4 or not and the other steps required?
assistant
#Here is code to find whether a given number is a power of 4 or not and the other steps required.
 def isPowerOfFour ( n ) :
	if ( n == 0 ) :
		return False
	while ( n != 1 ) :
		if ( n % 4 != 0 ) :
			return False
		n = n // 4
	return True
test_no = 64
if ( isPowerOfFour ( 64 ) ) :
	print ( test_no , ' is ▁ a ▁ power ▁ of ▁ 4' )
else :
	print ( test_no , ' is ▁ not ▁ a ▁ power ▁ of ▁ 4' )