Python Slice Object
Postado 2023-02-27 22:23:14
0
6K
A slice object is used to specify how to slice a sequence. You can specify where to start the slicing, and where to end. You can also specify the step, which allows you to e.g. slice only every other item. Here's an example of the usage:
x = ("hi", "hello", "greetings", "hola")
y = slice(3)
print(x[y])
>> ("hi", "hello", "greetings")
Pesquisar
Categorias
- Arts
- Business
- Computers
- Jogos
- Health
- Início
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia Mais
Warrior. (2011)
The youngest son of an alcoholic former boxer returns home, where he's trained by his father for...
FOX 2, Live TV. Detroit USA
FOX 2 Detroit's mornings news includes weather and traffic on the 2's plus breaking local,...
The Hunt. (2020)
"Twelve strangers wake up in a clearing. They don't know where they are -- or how they got there....
Мясо и кровь. Wildland. (2020)
Ида, после гибели своей матери в автокатастрофе, переезжает жить к своей тёте и двоюродным...
The Interplay of Society and Law: Navigating the Complex Dynamics
In the intricate dance between society and law, each step influences the other, shaping the...