human
Snake case of a given sentence | Function to replace spaces and convert into snake case.
Converting space to underscor.
If not space , convert into lower character.
Driver program.
Calling function"
How can the above be solved in Python?
 ... Give me a code to snake case of a given sentence and the other steps required?
assistant
#Here is code to snake case of a given sentence and the other steps required.
 def convert ( string ) :
	n = len ( string ) ;
	string = list ( string ) ;
	for i in range ( n ) :
		if ( string [ i ] == ' ▁ ' ) :
			string [ i ] = ' _ ' ;
		else :
			string [ i ] = string [ i ] . lower ( ) ;
	string = " " . join ( string )
	print ( string ) ;
if __name__ == " _ _ main _ _ " :
	string = " I ▁ got ▁ intern ▁ at ▁ geeksforgeeks " ;
	convert ( string ) ;