Python Slice Object
Veröffentlicht 2023-02-27 22:23:14
0
12KB
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
Society and People: Navigating the Interplay of Collective and Individual Identities
Society, that vast tapestry of human interaction, is woven from the threads of individual lives....
The Gold Rush. (1925)
A prospector goes to the Klondike during the 1890s gold rush in hopes of making his fortune, and...
How to Learn to Tie Sea Knots
Sea knots for novice yachtsmen are one of the first sections of training in a sailing school....
How to Measure the Success of a Video Marketing Campaign
1. Introduction: Why Measuring Matters
Video marketing has become one of the most effective ways...
Double Indemnity. (1944)
A Los Angeles insurance representative lets an alluring housewife seduce him into a scheme of...