In this post, we are going to create a simple python function program which will take in a string and then reverses all those words within that string.
We are going to accomplish our goal in three steps. 1) Spit the string into a
def reverseWords(str): reverse = str.split(' ') reverse.reverse() return ' '.join(reverse)
Very simple solution, if you got better idea, leave your thought under the comment box below!