Subscript
The so-called index is the number, like supermarket storage cabinet number, through this number will be able to find the appropriate storage space.
Python, strings, lists, tuples support the subscript index.
E.g:
# If you want to remove the portion of the character, using the subscript name = " ABCD " Print (name [0]) Print (name [. 1 ]) Print (name [2 ]) Print (name [. 3 ]) # output is: # A # B # C # D
slice
It refers to an operation of a portion of a slice of the operation of the object taken, strings , lists , tuples support slicing operation.
Grammar sections: [start: end: step]
Note : Select the closed section belonging to the left and right open type, that is, from the start "start" position to the "end" before the end of a bit (do not include the end of the bit itself).
We have an example to explain the string: