Slicing extracts a portion of a list using the syntax list[start:stop]. The slice includes the start index but excludes the stop index. Given letters = ["a", "b", "c", "d", "e"], letters[1:4] returns ["b", "c", "d"].
Elements at indices , , and . Omitting start defaults to : letters[:3] returns ["a", "b", "c"]. Omitting stop goes to the end: letters[2:] returns ["c", "d", "e"].
Omitting both copies the entire list: letters[:] returns ["a", "b", "c", "d", "e"]. Slicing never raises IndexError. Out-of-range indices are handled gracefully by returning fewer elements.