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
Am I Spending Too Much? Understanding Overspending and How to Regain Control
Am I Spending Too Much? Understanding Overspending and How to Regain Control
We’ve all had...
PLAYTV by Brightcove.
Learn how to navigate all types of communication with PLAYTV by Brightcove. Featuring a curated...
Build a 2D game with Python
Python is an outstanding language for people learning to program, and perfect for anyone...
What Are Examples of Successful Business Strategies?
In the ever-changing landscape of business, companies need to adopt strategies that ensure...
What Are the Best Ways to Finance a Startup?
Starting a business requires capital, and securing the right funding can determine the success or...