Python Slice Object
Posté 2023-02-27 22:23:14
0
4KB
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")
Rechercher
Catégories
- Arts
- Business
- Computers
- Jeux
- Health
- Domicile
- Kids and Teens
- Argent
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Lire la suite
Охота. The Hunt. (2012)
42-летний Лукас живет в небольшой датской деревушке, работает воспитателем в детском саду и...
The Dark Knight. (2008)
When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must...
Top 5 Horror Movies You Need to Watch
Horror movies have a unique ability to evoke fear, suspense, and thrill. From psychological...
WALL·E (2008)
In the distant future, a small waste-collecting robot inadvertently embarks on a space journey...
Interpreting the aggregate demand/aggregate supply model
Key points
The aggregate demand/aggregate supply model is a model that...