MicrolearnENPTES

Slices

Lesson 14 of 20 · Py.Micro

Take a piece of a list or string with [start:stop:step].

Like range, the stop is excluded: [1:4] gives positions 1, 2 and 3. Slicing never changes the original.

Do it in the browser: a real Python tool, a short mission and instant feedback. No install.

Start this lesson — free
← ListsDictionaries →

All lessons · Py.Micro