Python Slice Object

0
8كيلو بايت

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
The Great Dictator. (1940)
Dictator Adenoid Hynkel tries to expand his empire while a poor Jewish barber tries to avoid...
بواسطة Leonard Pokrovski 2022-12-21 19:24:05 0 17كيلو بايت
Programming
Python Hello World Easter Egg
Python has gotten another easter egg from the module __hello__ or __phello__. When importing that...
بواسطة Jesse Thomas 2023-04-14 20:11:18 0 9كيلو بايت
Mental Health
ADHD: Behavioural therapies
There is good evidence for the use of behavioural therapies in ADHD. They are the recommended...
بواسطة Kelsey Rodriguez 2023-04-27 17:37:46 0 8كيلو بايت
Television
FOX 5, Live TV New York USA
New York news, weather, traffic and sports from FOX 5 NY serving New York City, Long Island, New...
بواسطة Nikolai Pokryshkin 2022-09-15 08:32:41 0 34كيلو بايت
Business
Meetings are a total waste of time. Here's how to make them useful
If you've ever sat through a meeting and left wondering, "What was the point of that?", you're...
بواسطة Dacey Rankins 2025-06-03 13:21:34 0 3كيلو بايت
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov