human
Count of N digit Numbers whose sum of every K consecutive digits is equal | Function to count the number of N - digit numbers such that sum of every k consecutive digits are equal.
Range of numbers.
Extract digits of the number.
Store the sum of first K digits.
Check for every k - consecutive digits using sliding window.
Driver Code.
Given integer N and K"
How can the above be solved in Python?

=====
Can you provide a code to count of N digit Numbers whose sum of every K consecutive digits is equal and the other steps required?
assistant
#Here is code to count of N digit Numbers whose sum of every K consecutive digits is equal and the other steps required.
 def countDigitSum ( N , K ) :
	l = pow ( 10 , N - 1 ) ;
	r = pow ( 10 , N ) - 1 ;
	count = 0 ;
	for i in range ( 1 , r + 1 ) :
		num = i ;
		digits = [ 0 ] * ( N ) ;
		for j in range ( N - 1 , 0 , - 1 ) :
			digits [ j ] = num % 10 ;
			num //= 10 ;
		sum = 0 ;
		flag = 0 ;
		for j in range ( 0 , K ) :
			sum += digits [ j ] ;
		for j in range ( K , N ) :
			if ( sum - digits [ j - K ] + digits [ j ] != sum ) :
				flag = 1 ;
				break ;
		if ( flag == 0 ) :
			count += 1 ;
	return count ;
if __name__ == ' _ _ main _ _ ' :
	N = 2 ;
	K = 1 ;
	print ( countDigitSum ( N , K ) ) ;