Reverse words in a given String in Python
We are given a string and we need to reverse words of a given string?
Input : str = geeks quiz practice code Output : str = code practice quiz geeks
- Separate each word in given string using split() method of string data type in python.
- Reverse the word separated list.
- Print words of list, in string form after joining each word with space using ” “.join() method in python.
code practice quiz geeks
Last Updated on October 28, 2021 by admin