Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
289 B
1
Indexable
Never
def is_power_of_b(a, b):
    if a == 0:
        return False
    while a % b == 0:
        a /= b
    return a == 1

def main():
    a = int(input("Enter the value of a: "))
    b = int(input("Enter the value of b: "))
    print(is_power_of_b(a, b))

if __name__ == "__main__":
    main()
Leave a Comment