Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesPython FoundationsModule 3 · Functions and stringsTransfer: slice [::-1]predict52 / 174
+75 XP
Task
📝 **Task:** Predict what the program will output. ```python s = "Python" print(s[1:4]) print(s[::-1]) ``` 📋 Enter two lines and check. 💡 **Hint:** - `s[1:4]` — characters from index 1 to 3 (4 is NOT included) - `s[::-1]` — the entire line is backwards 🎯 Think: what characters does `"Python"` have in positions 1, 2, 3?
Predict the output

Read the code carefully

s = "Python"
print(s[1:4])
print(s[::-1])

What will the program print? Write here:

💬 Discussion

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