Q:

Write a Python program to reverse words in a string

0

 Write a Python program to reverse words in a string.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def reverse_string_words(text):
    for line in text.split('\n'):
        return(' '.join(line.split()[::-1]))
print(reverse_string_words("The quick brown fox jumps over the lazy dog."))
print(reverse_string_words("Python Exercises."))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now