Python Slice Object

0
6K

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")

Pesquisar
Categorias
Leia Mais
Sport
Warrior. (2011)
The youngest son of an alcoholic former boxer returns home, where he's trained by his father for...
Por Leonard Pokrovski 2023-03-12 17:31:43 0 16K
Television
FOX 2, Live TV. Detroit USA
FOX 2 Detroit's mornings news includes weather and traffic on the 2's plus breaking local,...
Por Nikolai Pokryshkin 2022-09-19 09:03:51 0 33K
Social Issues
The Hunt. (2020)
"Twelve strangers wake up in a clearing. They don't know where they are -- or how they got there....
Por Leonard Pokrovski 2022-10-29 17:43:21 0 17K
Социальные проблемы
Мясо и кровь. Wildland. (2020)
Ида, после гибели своей матери в автокатастрофе, переезжает жить к своей тёте и двоюродным...
Por Nikolai Pokryshkin 2022-10-19 17:58:26 0 18K
Law
The Interplay of Society and Law: Navigating the Complex Dynamics
In the intricate dance between society and law, each step influences the other, shaping the...
Por Dacey Rankins 2024-06-10 19:55:49 0 8K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov