Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
354 B
2
Indexable

number_n= int(input("masukkan bilangan N: "))
number_k = int(input("masukkan bilangan K: "))

first_n = number_n
while not (number_n ==1 or number_k == 0):
    number_n //= number_k

if number_n == 1:
    print(f"{first_n} merupakan perpangkatan {number_k}")
elif number_n % number_k != 0:
    print(f"{first_n} bukan merupakan perpangkatan {number_k}")