Slicing Strings in Python - Python Tutorial - w3Schools - Ch#10 English

preview_player
Показать описание
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.

Slice From the Start
By leaving out the start index, the range will start at the first character.

Slice To the End
By leaving out the end index, the range will go to the end.

Negative Indexing
Use negative indexes to start the slice from the end of the string.
Рекомендации по теме