Python Slice Object

0
12KB

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
Financial Services
How perfectly competitive firms make output decisions
Key points As a perfectly competitive firm produces a greater quantity of output,...
Von Mark Lorenzo 2023-02-21 15:16:17 0 16KB
Искусство, культура и развлечения
Звук металла. Sound of Metal. (2020)
Blackgammon – так называется панк-металическая группа, сколоченная барабанщиком Рубеном и...
Von Nikolai Pokryshkin 2022-09-25 20:31:20 0 40KB
Business
Technologies for Small Business Growth: From Startup to Success
The impact of digital technologies on the growth of startupsDigital technologies play a key role...
Von Dacey Rankins 2024-09-11 13:52:25 0 17KB
Personal Finance
How Much Should I Have in an Emergency Fund? 3 Months or 6 Months? How Big Should My Emergency Fund Be?
How Much Should I Have in an Emergency Fund? 3 Months or 6 Months? How Big Should My Emergency...
Von Leonard Pokrovski 2025-12-03 17:08:28 0 3KB
Social Issues
Monster (2021)
Monster tells the story of Steve Harmon (Kelvin Harrison, Jr.) a seventeen-year-old honor student...
Von Leonard Pokrovski 2022-09-07 13:37:58 0 37KB

BigMoney.VIP Powered by Hosting Pokrov