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
Can I Repair My Credit on My Own?
Can I Repair My Credit on My Own?
Yes, you can dispute inaccuracies, negotiate with creditors,...
How Do I Save Money for Kids’ Education?
How Do I Save Money for Kids’ Education?
College Savings Plans, Education Funds, and 529...
Price ceilings and price floors
Key points
Price ceilings prevent a price from rising above a certain level....
The collapse of Silicon Valley bank
The collapse of Silicon Valley Bank: how and why the main bank of techno-startups of Silicon...
Why Do Companies Rebrand?
Rebranding is one of the most powerful — and risky — strategies a business can...