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
Социальные проблемы
Карты, деньги, два ствола. Lock, Stock and Two Smoking Barrels. (1998)
Четверо молодых парней накопили каждый по 25 тысяч фунтов, чтобы один из них мог сыграть в карты...
Von Nikolai Pokryshkin 2023-03-04 12:57:43 0 35KB
Business
What Legal Steps Are Required to Start a Business?
Starting a business involves more than just a great idea—it requires careful legal planning...
Von Dacey Rankins 2025-03-13 15:43:16 0 13KB
Mental Health
Psychosis: Causes Pt.2
Psychiatric disordersFrom a diagnostic standpoint, organic disorders were believed to be caused...
Von Kelsey Rodriguez 2023-05-25 18:55:36 0 11KB
Social Issues
The Assistant. (2020)
A searing look at a day in the life of an assistant to a powerful executive. As Jane follows her...
Von Leonard Pokrovski 2023-05-30 19:54:29 0 29KB
Business
Organizing Chart: Hats and What's Underneath?
Do we really need structure... It is good if everything works smoothly in the company: work...
Von Dacey Rankins 2024-09-23 14:40:42 0 15KB

BigMoney.VIP Powered by Hosting Pokrov