human
Check if number formed by joining two Numbers is Perfect Cube | Function to check if a number is a perfect Cube or not.
Function to check if concatenation of two numbers is a perfect cube or not.
Convert numbers to string using to_string ( ).
Concatenate the numbers and convert it into integer.
Check if concatenated value is perfect cube or not.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to check if number formed by joining two Numbers is Perfect Cube and the other steps required.
 def isPerfectCube ( x ) :
	x = abs ( x )
	return int ( round ( x ** ( 1. / 3 ) ) ) ** 3 == x
def checkCube ( a , b ) :
	s1 = str ( a )
	s2 = str ( b )
	c = int ( s1 + s2 )
	if ( isPerfectCube ( c ) ) :
		print ( " Yes " )
	else :
		print ( " No " )
if __name__ == ' _ _ main _ _ ' :
	a = 6
	b = 4
	checkCube ( a , b )