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

البحث
الأقسام
إقرأ المزيد
Social Issues
Toy Story. (1995)
A cowboy doll is profoundly threatened and jealous when a new spaceman action figure supplants...
بواسطة Leonard Pokrovski 2023-01-01 20:51:01 0 21كيلو بايت
Научная фантастика и фэнтези
Властелин колец: Возвращение короля. The Lord of the Rings: The Return of the King. (2003)
Повелитель сил тьмы Саурон направляет свою бесчисленную армию под стены Минас-Тирита, крепости...
بواسطة Nikolai Pokryshkin 2022-11-03 20:37:27 0 39كيلو بايت
Business
How Does Intrapreneurship Differ from Entrepreneurship?
In today’s fast-paced and innovation-driven world, both entrepreneurship and...
بواسطة Dacey Rankins 2025-04-17 12:47:02 0 8كيلو بايت
Television
PLAYTV by Brightcove.
Learn how to navigate all types of communication with PLAYTV by Brightcove. Featuring a curated...
بواسطة Nikolai Pokryshkin 2023-05-13 12:52:08 0 39كيلو بايت
Social Issues
Girl in the Basement. (2021)
Sarah is a teen girl who is looking forward to her 18th birthday to move away from her...
بواسطة Leonard Pokrovski 2023-04-28 19:44:31 0 31كيلو بايت

BigMoney.VIP Powered by Hosting Pokrov