human
Move spaces to front of string in single traversal | Function to find spaces and move to beginning.
Traverse from end and swap spaces.
Driver code"
How can the above be solved in Python?

Write me a code to move spaces to front of string in single traversal and the other steps required?
assistant
#Here is code to move spaces to front of string in single traversal and the other steps required.
 def moveSpaceInFront ( s ) :
	i = len ( s ) - 1 ;
	for j in range ( i , - 1 , - 1 ) :
		if ( s [ j ] != ' ▁ ' ) :
			s = swap ( s , i , j ) ;
			i -= 1 ;
	return s ;
def swap ( c , i , j ) :
	c = list ( c )
	c [ i ] , c [ j ] = c [ j ] , c [ i ]
	return ' ' . join ( c )
s = " Hey ▁ there , ▁ it ' s ▁ GeeksforGeeks " ;
s = moveSpaceInFront ( s ) ;
print ( s ) ;