human
Count the occurrence of digit K in a given number N using Recursion | Function to count the digit K in the given number N.
Extracting least significant digit.
Driver Code"
How can the above be solved in Python?

=====
Can you provide a code to count the occurrence of digit K in a given number N using Recursion and the other steps required?
assistant
#Here is code to count the occurrence of digit K in a given number N using Recursion and the other steps required.
 def countdigits ( n , k ) :
	if n == 0 :
		return 0
	digit = n % 10
	if digit == k :
		return 1 + countdigits ( n / 10 , k )
	return countdigits ( n / 10 , k )
if __name__ == " _ _ main _ _ " :
	n = 1000 ;
	k = 0 ;
	print ( countdigits ( n , k ) )