Python Slice Object

0
4K

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")

Zoeken
Categorieën
Read More
Media
Dial M for Murder. (1954)
A former tennis star arranges the murder of his adulterous wife. My Link
By Leonard Pokrovski 2023-03-07 19:29:16 0 11K
Business
Lean Product Planning: How to Repeat the Path of Tesla and Not Become Yo-Mobile
Lean Product Planning: How to Repeat the Path of Tesla and Not Become Yo-Mobile I want to tell...
By Leonard Pokrovski 2024-08-21 23:52:41 0 10K
Publishing and Printing
Publishing and Printing: The Backbone of Knowledge and Communication
Publishing and printing have been integral to the dissemination of information,...
By Dacey Rankins 2024-11-15 15:09:24 0 4K
Regional
Art of Western Europe in the 1800's
The eighteenth century in Western Europe is the last stage of the long transition from feudalism...
By FWhoop Xelqua 2023-07-12 18:20:50 0 20K
Employment
Science Employment: Careers Shaping the Future
The field of science is broad, diverse, and integral to the advancement of society. Science...
By Dacey Rankins 2024-12-11 15:04:16 0 503
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov