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.

By

Updated

Cheat sheet: Slicing Lists and Strings
Category
Python
Level
Apprentice
Tags
Immutable, Mutable, python, Slicing, String (python)