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
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Mehr lesen
What Is the Viral Coefficient (K-Factor) and How Is It Calculated?
Viral growth has become a defining characteristic of some of the world’s most successful...
How Do Companies Decide Between Debt and Equity Financing?
How Do Companies Decide Between Debt and Equity Financing?
When companies need money to grow,...
How Do Time Spans Affect Our Understanding of Growth?
Growth is not a single, uniform process. Its meaning and significance shift dramatically...
Rocky. (1976)
A small-time Philadelphia boxer gets a supremely rare chance to fight the world heavyweight...
Should I Pay Off My Credit Card or Save?
Should I Pay Off My Credit Card or Save?
Deciding whether to pay off credit card debt or focus...