← Python

Lists – Slicing

A slice [start:stop] extracts a sub-list from a list

What it does: Slice from index 1 up to (not including) index 4. Step -1 traverses the list backwards, producing a reversed copy. Start at index 1, stop before 4: 20(1) 30(2) 40(3). [:2] takes indices 0 and 1: 10, 20. [2:] starts at index 2 and takes everything to the end. Slicing always returns a new list — the original is unchanged. Step of -1 reverses the list. Step of 2 starts at index 0: items at 0, 2, 4 = 1, 3, 5.

Common mistakes: Use colon : for slicing, not comma. Use square brackets for slicing, not parentheses.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
[10,20,30,40,50][1:4] returns?
[20, 30, 40][10, 20, 30, 40]
Matches
❌ nums = [1,2,3,4,5] nums[1,3]
Error: Use colon for slicing
Applying
Meanings
Term
list[start:stop]
Meaning
Get items from start up to but not including stop.
Practice
nums = [10, 20, 30, 40, 50]
Testing
Gaps
print(nums[:3])
Check Answer
Spots
1nums = [10, 20, 30]
2part = nums[0,2]

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Barreleye Fish' badge — Clear Vision, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. [10,20,30,40,50][1:4] returns?
A. [20, 30, 40] ✓
B. [10, 20, 30, 40]
Start at index 1, stop before 4: 20(1) 30(2) 40(3)
2. [10,20,30,40][:2] returns?
A. [10, 20, 30]
B. [10, 20] ✓
[:2] takes indices 0 and 1: 10, 20
3. [10,20,30,40][2:] returns?
A. [30, 40] ✓
B. [10, 20]
[2:] starts at index 2 and takes everything to the end
4. Does list slicing modify the original?
A. Yes
B. No creates a new list ✓
Slicing always returns a new list — the original is unchanged
5. [1,2,3,4,5][::-1] returns?
A. [5, 4, 3, 2, 1] ✓
B. [1, 2, 3, 4, 5]
Step of -1 reverses the list

Match the Pairs

nums = [1,2,3,4,5] nums[1,3] Error: Use colon for slicing
nums = [1,2,3] nums[::0] Error: Slice step cannot be zero
nums = [1,2,3,4,5] nums[1:4] Valid: Returns [2, 3, 4]
nums[::-1] Ok: Reverses the list
n = [10,20,30,40,50] print(n[:3]) Output: [10, 20, 30]
n = [1,2,3,4,5] print(n[::2]) Output: [1, 3, 5]

Key Term

list[start:stop]
Get items from start up to but not including stop.~~list[:stop]

Fill in the Blanks

1. nums = [10, 20, 30, 40] print(nums[0:3])
2. nums = [10, 20, 30, 40] print(nums[2:4])
3. nums = [1, 2, 3, 4, 5] print(nums[::-1])
4. nums = [1, 2, 3] copy = nums[:]
5. nums = [10, 20, 30, 40, 50] print(nums[:2])

Spot the Error

Question 1
A nums = [10, 20, 30]
B part = nums[0,2]
C print('Slice:', part)
D print('Done')
Line B — Use colon : for slicing, not comma
Question 2
A nums = [10, 20, 30, 40]
B part = nums(1:3)
C print('Slice:', part)
D print('Done')
Line B — Use square brackets for slicing, not parentheses
Question 3
A nums = [1, 2, 3, 4, 5]
B part = nums[1:4:0]
C print('Slice:', part)
D print('Done')
Line B — Step cannot be 0: causes ValueError
Question 4
A nums = [1, 2, 3]
B copy = nums
C copy[0] = 99
D # expects nums unchanged
Line B — copy = nums doesn't copy: both point to the same list. Use nums[:] to copy.
Question 5
A nums = [10, 20, 30, 40, 50][-1:-4]
B label = 'Slice'
C print('Slice:', nums)
D print('Done')
Line A — Start must come before stop: -4 comes before -1
For Teachers

Create a free class, add this module to a journey, and track who's stuck.

Create a free teacher account →

No credit card. No setup fee. Make a class and invite students in under three minutes.

For Students

Practice this topic interactively, track progress, and unlock badges.

Start Learning Free →

Have a class code?