Python Slice Object
Posted 2023-02-27 22:23:14
0
7K
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")
Search
Categories
- Arts
- Business
- Computers
- Games
- Health
- Home
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Read More
Я хотел спрятаться. Hidden Away. (2020)
Тони - сын итальянских эмигрантов. После смерти матери его усыновляет немецкоговорящая семья в...
Victims of gambling. Is gambling for money a vice or entertainment?
Gambling has been around since time immemorial. Craps were played in Babylon, Ancient Egypt and...
Understanding Home Consumer Information: A Guide for Homeowners
Navigating the world of homeownership can be overwhelming, especially with the vast amount of...
Касабланка. Casablanca. (1942)
Оставивший родину американец Рик Блэйн, владелец игорного клуба в Касабланке, встречается с...
How Do Startup Founders Attract Their First Customers?
For many startup founders, one of the biggest challenges they face is attracting their first...