Section: Lists

Slice a list

python
python
subset = items[1:4]

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Lists
Reverse slice copy
Reverse slice copy
OpenIn sheetpythonsame section
Append item
Append item
OpenIn sheetpythonsame section
Extend list
Extend list
OpenIn sheetpythonsame section
Insert at index
Insert at index
OpenIn sheetpythonsame section
Sort in place
Sort in place
OpenIn sheetpythonsame section
Sorted copy
Sorted copy
OpenIn sheetpythonsame section