Type a Python slice expression to see which elements are selected from the list. Supports positive/negative indices, start:stop:step notation, and reversal.
my_list = ["A", "B", "C", "D", "E", "F", "G"]
0
1
2
3
4
5
6
A
B1
C2
D3
E
F
G
-7
-6
-5
-4
-3
-2
-1
my_list
Result
my_list[1:4] =["B", "C", "D"]
Selects 3 elements. Numbers on badges show selection order.
Syntax: [start:stop:step]stop is exclusiveNegative indices count from the end[::-1] reverses the list