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
Geschichte
Hotel Rwanda. (2004)
Paul Rusesabagina, a hotel manager, houses over a thousand Tutsi refugees during their struggle...
Von Leonard Pokrovski 2023-04-15 18:35:18 0 27KB
Visual Arts
The World of Visual Arts: A Creative Journey Through Time and Expression
Visual arts, encompassing a wide range of artistic disciplines, have been an essential part of...
Von Dacey Rankins 2024-11-07 16:31:47 0 13KB
News and Media
15 fascinating popular science channels
1. AsapSCIENCE Did the egg come before the chicken or vice versa? The authors of the...
Von FWhoop Xelqua 2023-04-05 13:31:53 0 29KB
Life Issues
Room. (2015)
A little boy is held captive in a room with his mother since his birth, so he has never known the...
Von Leonard Pokrovski 2023-04-12 20:32:38 0 31KB
Social Issues
Unhinged (2020)
Academy Award winner Russell Crowe stars in Unhinged, a psychological thriller that takes...
Von Leonard Pokrovski 2022-10-19 17:09:27 0 24KB

BigMoney.VIP Powered by Hosting Pokrov