Python List Slicing
Multiple Choice Easy
Question
What is the result of `[10, 20, 30, 40, 50][1:4]`?
Hint
Slicing [start:end] includes start but excludes end.
Explanation
List slicing [1:4] includes index 1 up to but not including index 4. Index 1 = 20, index 2 = 30, index 3 = 40. So the result is [20, 30, 40]. Python slicing is start-inclusive, end-exclusive.
Related Resources
Related Lessons
- Lists
List slicing.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.