Welcome to the lesson on Python Strings - Slicing
You can return a range of characters by using the slice syntax.
Specify the start index and the end index, separated by a colon, to return a part of the string.
Some Examples: Get the characters from position 3 to position 7 (not included):
Note: The first character has index 0.
Slice From the Start
By leaving out the start index, the range will start at the first character:
Some Examples: Get the characters from the start to position 5 (not included):
Slice To the End
By leaving out the end index, the range will go to the end:
Some Examples: Get the characters from position 2, and all the way to the end:
End of Python Strings - Slicings
You have learned String Slicing in simple terms. Let's proceed on to Modify Strings.