Strings – Slicing
A slice [start:stop] extracts a substring from position start up to but not including stop
What it does: Omitting start defaults to 0. Slices from index 0 up to (not including) 3. Step -1 traverses the string backwards — a quick way to reverse. Start at 0, stop before 3: P(0) y(1) t(2). [:2] starts from 0, stops before index 2: h(0) e(1). [3:] starts at index 3 and takes everything to the end: l(3) o(4). Step of 2: take index 0, 2, 4 = a, c, e. Step of -1 reverses the string. Start and stop at the same index — nothing in between.
Common mistakes: Use colon : for slicing, not comma. Step cannot be 0: causes ValueError.
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.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
SliceFill in the Blanks
Spot the Error
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.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →