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
Телевидение
Белорецкая телекомпания (БТК). Прямой эфир.
Телевидение города Белорецка. Новости Белорецка на русском языке. Для просмотра телеканала за...
Von Nikolai Pokryshkin 2022-10-23 12:25:51 0 28KB
Телевидение
PUBLIKA Live TV. Телевидение на русском, молдавском и румынском.
Телевидение Молдавии на русском и молдавском языках. Новости, погода, политика, происшествия и...
Von Nikolai Pokryshkin 2022-10-31 14:28:01 0 30KB
Programming
JavaScript vs TypeScript
Difference between TypeScript and JavaScript JavaScript and TypeScript look very similar, but...
Von Jesse Thomas 2023-05-26 21:10:06 0 11KB
Business
Interaction with contractors — how to improve work with a programmer
In general, is it worth trying to improve this interaction with developers at all? Why should the...
Von Dacey Rankins 2024-09-18 16:35:51 0 15KB
Financial Services
What factors change demand?
Key points Demand curves can shift. Changes in factors like average income and...
Von Mark Lorenzo 2023-06-27 18:14:33 0 11KB

BigMoney.VIP Powered by Hosting Pokrov