Skip to main content
← CoursesPython FoundationsModule 3 · Functions and stringsRow reversewrite33 / 170
💬 Discuss🧪 Playground+75 XP
Task
📝 **Task:** Write `reverse(s)` returning the string reversed. 📋 **Steps:** 1. `def reverse(s):` 2. Slice with step `-1`: `return s[::-1]` 3. Call `reverse("Python")` 💡 **Similar example:** ```python def flip(text): return text[::-1] print(flip("hello")) # "olleh" ``` 🎯 **Expected output:** `nohtyP`

Keep going

✏️ Write your code here
🐍
Loading Python...
First visit only — ~5-10s. Stays cached afterward.
📊 Result
Press Run to see result...
📣 Help someone learn PythonShare this lesson with a friend — the first 15 are free, no signup.Tweet

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…