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
Жизненные вопросы
Отец. The Father. (2020)
Энтони уже далеко не молод и живет один в лондонской квартире. Он считает, что прекрасно...
Von Nikolai Pokryshkin 2023-02-05 12:53:46 0 30KB
Телевидение
Прямой эфир ТНТ4.
ТНТ4 — федеральный тематический телеканал с целевой аудиторией 14 – 44, начавший...
Von Nikolai Pokryshkin 2022-10-02 08:04:15 1 37KB
Geld
How Much House Can I Afford?
How Much House Can I Afford? Buying a home is one of the most significant financial decisions...
Von Leonard Pokrovski 2025-09-22 19:23:18 0 6KB
Научная фантастика и фэнтези
Бегущий по лезвию. Blade Runner. (1982)
Ноябрь 2019 года. Бывший охотник на андроидов Рик Декард восстановлен в полиции Лос-Анджелеса для...
Von Nikolai Pokryshkin 2023-03-17 14:58:57 0 33KB
Sicherheit
Understanding Computer Security: Safeguarding the Digital Age
In today’s interconnected world, where nearly every aspect of our lives is touched by...
Von Dacey Rankins 2024-11-15 14:56:17 0 13KB

BigMoney.VIP Powered by Hosting Pokrov