# Slicing Lists and Strings

A slice such as stops\[1:4\] takes part of a list or a string, from the start index up to but not including the stop index, with an optional step, and because a string can't be changed in place, you build a changed copy from slices instead.

![Cheat sheet: Slicing Lists and Strings](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/bd65e86806db40fb8db38aa1ef4a18af.webp)

- Category: Python
- Level: Apprentice
- Tags: Immutable, Mutable, python, Slicing, String (python)
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/python-indexing-and-slicing-cheat-sheet
