Challenge: Reverse Words in a Sentence
Task
Swipe to start coding
Write a function that reverses the order of words in a given sentence using a loop.
- The function must split the input sentence into words.
- The function must use a loop to reconstruct the sentence with the words in reverse order.
- The function must return the reversed sentence as a single string.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 4
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 5.56
Challenge: Reverse Words in a Sentence
Swipe to show menu
Task
Swipe to start coding
Write a function that reverses the order of words in a given sentence using a loop.
- The function must split the input sentence into words.
- The function must use a loop to reconstruct the sentence with the words in reverse order.
- The function must return the reversed sentence as a single string.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 4
single