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 : Recursion
Code Type : Recursive function
Code Difficulty : Intermediate
def a_is_power_of_b(a, b):
if a == 1:
return True
if a % b != 0:
return False
return a_is_power_of_b(a // b, b)