human
Check if a number is a power of another number | Returns true if y is a power of x.
The only power of 1 is 1 itself.
Repeatedly compute power of x.
Check if power of x becomes y.
check the result for true / false and print"
Solution in Python:
assistant
#Here is code to check if a number is a power of another number and the other steps required.
 def isPower ( x , y ) :
	if ( x == 1 ) :
		return ( y == 1 )
	pow = 1
	while ( pow < y ) :
		pow = pow * x
	return ( pow == y )
if ( isPower ( 10 , 1 ) ) :
	print ( 1 )
else :
	print ( 0 )
if ( isPower ( 1 , 20 ) ) :
	print ( 1 )
else :
	print ( 0 )
if ( isPower ( 2 , 128 ) ) :
	print ( 1 )
else :
	print ( 0 )
if ( isPower ( 2 , 30 ) ) :
	print ( 1 )
else :
	print ( 0 )