human
Write me a code to find the String having each substring with exactly K distinct characters and the other steps required given the following:
Find the String having each substring with exactly K distinct characters | Function to find the required output string.
Each element at index i is modulus of K.
Driver code.
initialise integers N and K"
How can the above be solved in Python?
assistant
#Here is code to find the String having each substring with exactly K distinct characters and the other steps required.
 def findString ( N , K ) :
	for i in range ( N ) :
		print ( chr ( ord ( ' A ' ) + i % K ) , end = " " ) ;
if __name__ == " _ _ main _ _ " :
	N = 10 ;
	K = 3 ;
	findString ( N , K ) ;