human
Find indices of all occurrence of one string in other | Python program to find indices of all occurrences of one String in other ..
Driver code"
How can the above be solved in Python?
assistant
#Here is code to find indices of all occurrence of one string in other and the other steps required.
 def printIndex ( str , s ) :
	flag = False ;
	for i in range ( len ( str ) ) :
		if ( str [ i : i + len ( s ) ] == s ) :
			print ( i , end = " ▁ " ) ;
			flag = True ;
	if ( flag == False ) :
		print ( " NONE " ) ;
str1 = " GeeksforGeeks " ;
str2 = " Geeks " ;
printIndex ( str1 , str2 ) ;