This seems to be simple but I cannot find a way to do it. I need to show whether the cube root of an integer is integer or not. I used is_integer() float method
I think you should use the round function to get the answer. If I had to write a function then it will be as follows:
def cube_integer(n):
if round(n**(1.0/3.0))**3 == n:
return True
return False
You can use something similar to int(n**(1.0/3.0)) == n**(1.0/3.0), but in python because of some issues with the computation of the value of cube root, it is not exactly computed. For example int(41063625**(1.0/3.0)) will give you 344, but the value should be 345.