human
What is a code to check if a number can be represented as sum of two consecutive perfect cubes and the other steps required given the following:
Check if a number can be represented as sum of two consecutive perfect cubes | Function to check that a number is the sum of cubes of 2 consecutive numbers or not.
Condition to check if a number is the sum of cubes of 2 consecutive numbers or not.
Driver Code.
Function call"
How can the above be solved in Python?
assistant
#Here is code to check if a number can be represented as sum of two consecutive perfect cubes and the other steps required.
 def isSumCube ( N ) :
	a = int ( pow ( N , 1 / 3 ) )
	b = a - 1
	ans = ( ( a * a * a + b * b * b ) == N )
	return ans
i = 35
if ( isSumCube ( i ) ) :
	print ( " Yes " )
else :
	print ( " No " )