Python Slice Object

0
11KB

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
Mehr lesen
Climbing
Mountain Climbing: The Pursuit of Adventure and Challenge
Mountain climbing is one of the most exhilarating and challenging outdoor activities, blending...
Von Dacey Rankins 2024-12-06 15:30:18 0 12KB
Жизненные вопросы
Три идиота. 3 Idiots. (2009)
Двое друзей отправляются на поиски пропавшего приятеля. В этом путешествии им предстоит постоянно...
Von Nikolai Pokryshkin 2023-01-08 12:43:36 0 24KB
Transgendered
Navigating the Complexities of Transgender Identity: Understanding, Acceptance, and Empowerment
Navigating the Complexities of Transgender Identity: Understanding, Acceptance, and Empowerment...
Von Leonard Pokrovski 2024-06-13 09:57:31 0 20KB
Социальные проблемы
В порту. On the Waterfront. (1954)
В центре сюжета судьба простого докера - Терри Мэллоу, терзающегося сомнениями и решающего встать...
Von Nikolai Pokryshkin 2023-03-22 18:01:54 0 37KB
Institutions
TOP 15 Research Universities
The world was built as the product of intensive research. Most of the world's stunning...
Von FWhoop Xelqua 2022-12-11 15:49:25 0 20KB

BigMoney.VIP Powered by Hosting Pokrov