human
Give me a code to write a program to calculate pow ( x , n ) and the other steps required given the following:
Write a program to calculate pow ( x , n ) | Function to calculate x raised to the power y in O ( logn )"
Solution in Python:
assistant
#Here is code to write a program to calculate pow ( x , n ) and the other steps required.
 def power ( x , y ) :
	temp = 0
	if ( y == 0 ) :
		return 1
	temp = power ( x , int ( y / 2 ) )
	if ( y % 2 == 0 ) :
		return temp * temp ;
	else :
		return x * temp * temp ;