2 ms·
Slices in Python are not inclusive of the second index; lst[0:2] gives you a list containing the first two elements.
by haldean 12y ago
Slices in Python are not inclusive of the second index; lst[0:2] gives you a list containing the first two elements.