Python Slice Object
Postado 2023-02-27 22:23:14
0
7KB
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
How Can I Improve the Production Quality of My Content?
In today’s digital landscape, content creators are under pressure to produce high-quality...
How Do I Measure the Success of a Business Strategy?
How Do I Measure the Success of a Business Strategy?...
Пролетая над гнездом кукушки. One flew over the cuckoo's nest. (1975)
Рэндла Патрика Макмёрфи, патологического преступника и бунтаря, переводят из колонии в...
Могила светлячков. Grave of the Fireflies. (1988)
Последние дни Второй мировой войны, американская авиация бомбит беззащитные японские города. В...
"Veterinary medicine is exciting!"
"Veterinary medicine is exciting!"
Veterinary medicine is a field of scientific knowledge and...