human
Find the Nth occurrence of a character in the given String | Function to find the Nth occurrence of a character.
Loop to find the Nth occurrence of the character.
Driver Code"
Solution in Python:
assistant
#Here is code to find the Nth occurrence of a character in the given String and the other steps required.
 def findNthOccur ( string , ch , N ) :
	occur = 0 ;
	for i in range ( len ( string ) ) :
		if ( string [ i ] == ch ) :
			occur += 1 ;
		if ( occur == N ) :
			return i ;
	return - 1 ;
if __name__ == " _ _ main _ _ " :
	string = " geeks " ;
	ch = ' e ' ;
	N = 2 ;
	print ( findNthOccur ( string , ch , N ) ) ;