human
Reverse words in a given string | Set 2 | Function to reverse the words of a given string.
Stack to store each word of the string.
Store the whole string in stream.
Push each word of the into the stack.
Print the in reverse order of the words.
Driver Code"
How can the above be solved in Python?
 ... Write me a code to reverse words in a given string and the other steps required?
assistant
#Here is code to reverse words in a given string and the other steps required.
 def printRev ( strr ) :
	strr = strr . split ( " ▁ " )
	st = [ ]
	for i in strr :
		st . append ( i )
	while len ( st ) > 0 :
		print ( st [ - 1 ] , end = " ▁ " )
		del st [ - 1 ]
if __name__ == ' _ _ main _ _ ' :
	strr = " geeks ▁ quiz ▁ practice ▁ code "
	printRev ( strr )