Python Slice Object
Veröffentlicht 2023-02-27 22:23:14
0
11KB
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")
Suche
Kategorien
- Arts
- Business
- Computers
- Spiele
- Health
- Startseite
- Kids and Teens
- Geld
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Mehr lesen
Gpykin: Where Real Connections Begin
A New Era of Online Dating
In a world where people are busier, more mobile, and more digitally...
Which Metrics Matter Most at Growth Stages?
As a business grows, the metrics that matter most evolve. In the earliest stages, survival and...
Unveiling Earth's Secrets: Exploring the Wonders of Earth Sciences
Unveiling Earth's Secrets: Exploring the Wonders of Earth Sciences
Earth, our home planet, is a...
100+ questions that will save you from awkward silence in online meetings
As work communication moves online, appointments and meetings become somewhat more complex. Body...
How Do I Determine My Startup Costs and Other Expenses?
Starting a new business can be an exciting yet overwhelming experience. One of the most crucial...