Python Slice Object

0
11Кб

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

Поиск
Категории
Больше
Television
Fairfax Ch. 16. Live TV. Virginia, USA.
Stay informed! Watch Fairfax County public meetings live, and the latest events and activities on...
От Nikolai Pokryshkin 2022-10-14 17:17:39 0 27Кб
Истории
American Sniper. (2014)
Navy S.E.A.L. sniper Chris Kyle's pinpoint accuracy saves countless lives on the battlefield and...
От Leonard Pokrovski 2023-05-24 19:09:33 0 37Кб
Ужасы
Семь. Se7en. (1995)
Детектив Уильям Сомерсет - ветеран уголовного розыска, мечтающий уйти на пенсию и уехать подальше...
От Nikolai Pokryshkin 2022-11-14 12:13:12 0 32Кб
Business
What Are the Key Responsibilities of a Startup CEO?
  The role of a startup CEO is both exhilarating and daunting. Unlike in mature companies...
От Dacey Rankins 2025-05-01 16:21:54 0 9Кб
Научная фантастика и фэнтези
Звёздные войны: Эпизод 5 — Империя наносит ответный удар. Star Wars: Episode V - The Empire Strikes Back. (1980)
Борьба за Галактику обостряется в пятом эпизоде космической саги. Войска Императора начинают...
От Nikolai Pokryshkin 2022-11-12 13:20:55 0 35Кб

BigMoney.VIP Powered by Hosting Pokrov