Skip to content

Commit b269db9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 789e56a commit b269db9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

bit_manipulation/is_K_power_of_N.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This program checks if k is a power of n.
22

3+
34
def is_k_power_of_n(n, k):
45
"""
56
Checks if k can be reduced to 1 by repeatedly dividing it by n.
@@ -24,6 +25,7 @@ def is_k_power_of_n(n, k):
2425
k //= n
2526
return k == 1
2627

28+
2729
n = int(input("Enter the base (n): "))
2830
k = int(input("Enter the number to check (k): "))
2931
print(is_k_power_of_n(n, k))

0 commit comments

Comments
 (0)