Write a Python function to reverse words in a string.


Topic: Write a Python function to reverse words in a string.

Solution

def reverse_string_words(text):
    for line in text.split('\n'):
        return(' '.join(line.split()[::-1]))



List all Python Programs