List slicing extracts the subset of elements from a list
Syntax
listname[start:stop]
listname[start:stop:steps]
- Default value of start is 0
- Default value of stop is n-1
- [:] prints the entire list
- [a:a] prints the empty list. When start and stop is equal, then the slice is empty
Views: 0