Python Slice Object

0
4KB

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
Lire la suite
Социальные проблемы
Охота. The Hunt. (2012)
42-летний Лукас живет в небольшой датской деревушке, работает воспитателем в детском саду и...
Par Nikolai Pokryshkin 2023-01-12 17:44:38 0 15KB
Science Fiction and Fantasy
The Dark Knight. (2008)
When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must...
Par Leonard Pokrovski 2022-11-01 19:46:51 0 17KB
Horror
Top 5 Horror Movies You Need to Watch
Horror movies have a unique ability to evoke fear, suspense, and thrill. From psychological...
Par Dacey Rankins 2024-10-08 18:34:58 0 7KB
Science Fiction and Fantasy
WALL·E (2008)
In the distant future, a small waste-collecting robot inadvertently embarks on a space journey...
Par Leonard Pokrovski 2022-12-15 20:28:27 0 11KB
Financial Services
Interpreting the aggregate demand/aggregate supply model
Key points The aggregate demand/aggregate supply model is a model that...
Par Mark Lorenzo 2023-03-08 17:45:51 0 7KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov