Avsnitt 1. Kapitel 16
single
Challenge: Reverse Words in a Sentence
Svep för att visa menyn
Uppgift
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.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 16
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal