slice(start,stop,step) returns slice object for breaking string, list , tuple etc.
start
(optional) default = 0 , The start position of the slice
stop
( required ), slice should Stop before this position
step
( optional ) default =1 , step to consider for slicing
Start, stop and step values are indices of a range.
If one value is given then it is considered as stop value as default start is 0 and step value is 1.
If two values are given then it is considered as start and stop values and step value is set to 1
If three values are given then they are considered as start , stop and step values.
We will apply these slice objects to our list, tuple, string etc to break them at different positions.
Let us use slice object to break a list. While creating the slice object we have taken one parameter only so it will be used as stop value. Here start = 0 , stop=2 and step =1. Starting from 0th position, the slice will stop before 2 ( i.e at the 1st position ). The default value for step is 1.