human
Give me a code to dudeney Numbers and the other steps required given the following:
Dudeney Numbers | Function that returns true if n is a Dudeney number.
If n is not a perfect cube.
Last digit.
Update the digit sum.
Remove the last digit.
If cube root of n is not equal to the sum of its digits.
Driver code"
Solution in Python:
assistant
#Here is code to dudeney Numbers and the other steps required.
 def isDudeney ( n ) :
	cube_rt = int ( round ( ( pow ( n , 1.0 / 3.0 ) ) ) )
	if cube_rt * cube_rt * cube_rt != n :
		return False
	dig_sum = 0
	temp = n
	while temp > 0 :
		rem = temp % 10
		dig_sum += rem
		temp //= 10
	if cube_rt != dig_sum :
		return False
	return True
if __name__ == ' _ _ main _ _ ' :
	n = 17576
	if isDudeney ( n ) :
		print ( " Yes " )
	else :
		print ( " No " )