Python Slice Object

0
8K

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

Search
Categories
Read More
Телевидение
Телеканал "Первый Тульский". Прямая трансляция.
Телеканал «Первый Тульский» является единственным в Тульской области обладателем...
By Nikolai Pokryshkin 2022-11-05 18:35:51 0 23K
Business
What is Crowdfunding?
Crowdfunding is a modern fundraising method that enables individuals, organizations, and...
By Dacey Rankins 2025-03-27 18:05:50 0 4K
Arts, Culture and Entertainment
All About Eve. (1950)
A seemingly timid but secretly ruthless ingénue insinuates herself into the lives of an...
By Leonard Pokrovski 2023-02-07 13:22:59 0 23K
Play Groups
Collection of games
Team-Building Compilation CATERPILLARThe team stands in a single line, facing to...
By Leonard Pokrovski 2024-04-05 21:32:03 0 19K
Social Issues
The Sting. (1973)
Two grifters team up to pull off the ultimate con. My Link
By Leonard Pokrovski 2023-01-25 13:30:10 0 17K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov