Strings – Indexing: name[0]
Square bracket notation accesses a single character in a string by its zero-based position
What it does: Index 0 is always the first character. 'python'[0] is 'p'. Negative indices count from the end. -1 is always the last character. P=0, y=1, t=2, h=3, o=4, n=5. 'cat' has indices 0, 1, 2 — index 3 is out of range. [-1] is 'o', [-2] is the second from last: 'l'. A=0, l=1 — name[1] is the second character. Strings can't be changed in-place — create a new string instead. h-e-l-l-o = 5 characters.
Common mistakes: 'hello' has indices 0-4: index 5 is out of range. First character is at index 0, not 1.
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
IndexFill 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 →