I
and J
SLICE = STRING[I:J]
I
and
J
non-negative,
J
should be greater than
I
:
SLICE
consists of the (I
+1)-eth
up to and including the J
-eth character
Example:
name = "Sandy" firstSlice=name[0:3] secondSlice=name[1:3] print firstSlice, secondSlice
prints:
San an