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
Mental Health
ADHD: Medication - Stimulants
Methylphenidate and amphetamine or its derivatives are first-line treatments for ADHD as they are...
Von Kelsey Rodriguez 2023-04-28 18:05:20 0 12KB
История
Однажды на Диком Западе. Once Upon a Time in the West (1968)
Молодая вдова отказывается продать ферму дельцу, задумавшему проложить по этой земле железную...
Von Nikolai Pokryshkin 2022-12-07 19:10:08 0 28KB
Motorcycles
Embracing the Freedom of the Open Road: The Allure of Motorcycles
In a world often dominated by four-wheeled vehicles, motorcycles stand out as symbols of freedom,...
Von Dacey Rankins 2024-05-14 16:22:03 0 17KB
Телевидение
Башкортостан 24. Прямая трансляция телеканала.
Телеканал «Башкортостан 24» создан в 2016 году в соответствии с Указом Президента...
Von Nikolai Pokryshkin 2022-11-15 19:41:48 0 28KB
Mental Health
Autism Spectrum: Pharmacological interventions
Medications may be used to treat ASD symptoms that interfere with integrating a child into home...
Von Kelsey Rodriguez 2023-03-16 18:00:28 0 11KB

BigMoney.VIP Powered by Hosting Pokrov