human
Can you provide a code to sum of quotients of division of N by powers of K not exceeding N and the other steps required given the following:
Sum of quotients of division of N by powers of K not exceeding N | Function to calculate sum of quotients obtained by dividing N by powers of K <= N.
Store the required sum.
Iterate until i exceeds N.
Update sum.
Multiply i by K to obtain next power of K.
Prthe result.
Driver Code.
Given N and K"
How can the above be solved in Python?
assistant
#Here is code to sum of quotients of division of N by powers of K not exceeding N and the other steps required.
 def findSum ( N , K ) :
	ans = 0
	i = 1
	while ( i <= N ) :
		ans += N // i
		i = i * K
	print ( ans )
if __name__ == ' _ _ main _ _ ' :
	N , K = 10 , 2
	findSum ( N , K )