PythonSkills.org
Courses
Exercices
Challenges
Quizzes
Open console
0 points
Get started
Loading...
All Challenges
Loading...
Loading...
Reverse alternating words
Write a function that takes a sentence and reverses every other word, keeping the rest as is.
Advanced
Hint
sample input: "hello world this is OpenAI"
sample output: hello dlrow this si OpenAI
Loading...
Run Tests
Clear Tests
Test Output:
Show Solution
Show Code
Not Solved
Next challenge: Reverse string in pairs of two