Python Slice Object
Posté 2023-02-27 22:23:14
0
9KB
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
Egypt
Egypt (Arabic: Yeghipet; مصر Misr/Miṣr [misʕɾ], masri مصر Masr/Maṣr [ˈmɑsʕɾ], Copt. Ⲭⲏⲙⲓ...
V for Vendetta. (2005)
In a future British dystopian society, a shadowy freedom fighter, known only by the alias of "V",...
JavaScript forEach()
The forEach() method is an iterative method. It calls a...
How Does the Company Incorporate Diversity, Equity, and Inclusion in the Workplace?
In today’s dynamic business landscape, fostering a workplace culture rooted in diversity,...
The Fascinating World of Game Miniatures: From Collectibles to Gameplay
Game miniatures have become a central element in the world of tabletop games, bringing to life...