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
How Much Should My Salary Increase Each Year?
How Much Should My Salary Increase Each Year?
A Practical Guide to Raises, Inflation, and Career...
What is the difference between minimalism and simple living?
What Is the Difference Between Minimalism and Simple Living?
Minimalism and simple living are...
How do I create a minimalist workspace?
How Do I Create a Minimalist Workspace?
A minimalist workspace is not simply a “clean...
How to deal with procrastination guilt?
How to Deal With Procrastination Guilt
Procrastination guilt is the emotional aftermath of...
Why do currencies rise and fall?
Currencies are often described as “strong” or “weak,” but those labels...