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
Léon: The Professional. (1994)
12-year-old Mathilda is reluctantly taken in by Léon, a professional assassin, after her...
CGTN news (English) Live TV from China.
CGTN news, China Central Television (former CCTV 9) is a 24/7 news TV channel in the English...
Is It Possible to Maintain a Full-Time Job While Pursuing Indie Hacking Projects?
In today’s world of side hustles, freelancing, and remote work, the idea of juggling a...
Should I Apply to Multiple Positions Within the Same Company?
It’s not uncommon for job seekers to find more than one appealing role within the same...
A Comprehensive Guide to Airsoft: The Sport, Gear, and Community
Airsoft is an exciting, fast-paced sport that has grown in popularity over the years, attracting...