I am trying to determine whether an integer can be expressed in the form of a^b where b>1 and the given integer is greater than 0. My code runs fine for all test cases except for one. It gives wrong answer for the following input: 536870912 I cant understand why.
def isPower(self, A):
if(A==1):
return (1)
for i in range(2,int(A**0.5)+1):
val=log(A,i)
if(int(val)-val==0):
return (1)
else:
return (0)