Python Slice Object
Posted 2023-02-27 22:23:14
0
4K
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")
Buscar
Categorías
- Arts
- Business
- Computers
- Juegos
- Health
- Home
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Read More
PEP8 Quick Tip
When indenting, use tabs instead of spaces. Yes, PEP8 does tell you that spaces are suggested for...
Blackfish (2013)
A documentary following the controversial captivity of killer whales, and its dangers for both...
Шерлок младший. Sherlock Jr. (1924)
Б.Китон - киномеханик, который мечтает быть знаменитым детективом, как Шерлок Холмс. Влюбленный в...
Вверх. Up. (2009)
78-летний ворчун Карл Фредриксен считает, что жизнь обходит его стороной. Чтобы сдержать...
Men's Health: Why Do Some Men Find It Difficult To Talk About Their Problems And Illnesses?
One of the main reasons why men find it difficult to discuss their health and problems is...