Python Slice Object
Δημοσιευμένα 2023-02-27 22:23:14
0
12χλμ.
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")
Αναζήτηση
Κατηγορίες
- Arts
- Business
- Computers
- Παιχνίδια
- Health
- Κεντρική Σελίδα
- Kids and Teens
- Money
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Διαβάζω περισσότερα
How Will Inflation Affect My Retirement Savings?
How Will Inflation Affect My Retirement Savings?
Inflation—the gradual increase in the...
Soaring Through Time: The Art of Recreating Kites
Soaring Through Time: The Art of Recreating Kites
From the serene flight of a bird-shaped kite...
What Are Tariffs and Trade Agreements?
What Are Tariffs and Trade Agreements?
There is a peculiar habit among modern economists: they...
How to Start a Fintech Company: What’s Needed to Build a Fintech Startup
How to Start a Fintech Company: What’s Needed to Build a Fintech Startup
The fintech...
What is a Budget?
What is a Budget?
A budget is more than just numbers on a spreadsheet—it is a financial...