The code below isn\'t working right for some inputs.
a, i = set(), 1
while i <= 10000:
a.add(i)
i <<=
I have written a python function that will check the power of any number:
import math
def checkPowTwo(num):
x = int(input("The power of the number to be calculated is: "))
output = math.log(num, x)
residue = output - int(output)
if residue == 0:
print (num, " is a power of the number desired.")
else:
print (num, " is not a power of the number desired.")
y = checkPowTwo(int(input()))