https://paiza.jp/works/mondai/loop_problems2/loop_problems2__div_m
私の回答
N,M = map(int,input().split())
div_count = 0
while True:
if N % M == 0:
N //= M
div_count += 1
else:
break
print(div_count)
模範解答
N, M = map(int, input().split())
div_count = 0
while True:
if N % M == 0:
N //= M
div_count += 1
else:
break
print(div_count)
2で何回割れるの模範解答を基に、今回の回答を作ったので、ほぼ同じ回答になりました。