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
Природа и наука
Лошадь Мечты. Dream Horse. (2021)
Устав от обыденной жизни, Джен решает ее изменить. Не имея ни опыта, ни средств, она убеждает...
Von Nikolai Pokryshkin 2022-09-07 19:02:28 0 30KB
Business
What Is the CEO's Vision for the Future?
Exploring the CEO's Goals and Aspirations Reveals Their Strategic Direction and Long-Term...
Von Dacey Rankins 2025-07-01 13:45:42 0 4KB
Personal Finance
Can I work while collecting Social Security? — Income limits and how earnings affect your benefits
Can I work while collecting Social Security? — Income limits and how earnings affect your...
Von Leonard Pokrovski 2025-12-10 22:53:47 0 3KB
Financial Services
Timeline: Paying for college
Background Throughout this section of the resource, we focus on what...
Von Mark Lorenzo 2023-06-01 19:13:16 0 15KB
Autos
Checker Marathon - the famous New York taxi.
Checker Marathon is a taxi car that is well known to a huge number of people: someone used the...
Von Kirill Vasiliev 2023-01-14 22:56:28 0 30KB

BigMoney.VIP Powered by Hosting Pokrov