You can download this code by clicking the button below.
This code is now available for download.
Determine if one number is a power of another
Technology Stack : math
Code Type : Mathematical calculation function
Code Difficulty :
def a_is_power_of_b(a, b):
if a < b:
return False
while a % b == 0:
a = a // b
return a == 1