Python Slice Object
Posté 2023-02-27 22:23:14
0
7KB
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")
Rechercher
Catégories
- Arts
- Business
- Computers
- Jeux
- Health
- Domicile
- Kids and Teens
- Argent
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Lire la suite
Supercomputing: Unleashing the Power of Advanced Computing
Supercomputing represents the pinnacle of computational capability, enabling researchers and...
Ford против Ferrari. Ford v Ferrari. (2019)
В начале 1960-х Генри Форд II принимает решение улучшить имидж компании и сменить курс на...
String.prototype.match()
A regular expression object, or any object that has a Symbol.match method....
The Importance of Customer Service: Best Practices and Trends
In today’s competitive market, exceptional customer service has become a crucial...
How well GDP measures the well-being of society
Key points
GDP is an indicator of a society’s standard of living, but it is...