Python Slice Object

0
9KB

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

Rechercher
Catégories
Lire la suite
Middle East
Egypt
Egypt (Arabic: Yeghipet; مصر Misr/Miṣr [misʕɾ], masri مصر Masr/Maṣr [ˈmɑsʕɾ], Copt. Ⲭⲏⲙⲓ...
Par FWhoop Xelqua 2023-04-13 17:08:13 0 17KB
Social Issues
V for Vendetta. (2005)
In a future British dystopian society, a shadowy freedom fighter, known only by the alias of "V",...
Par Leonard Pokrovski 2023-03-03 19:27:17 0 19KB
Programming
JavaScript forEach()
The forEach() method is an iterative method. It calls a...
Par Jesse Thomas 2023-05-15 20:06:26 0 9KB
Business
How Does the Company Incorporate Diversity, Equity, and Inclusion in the Workplace?
In today’s dynamic business landscape, fostering a workplace culture rooted in diversity,...
Par Dacey Rankins 2025-06-12 14:51:23 0 6KB
Miniatures
The Fascinating World of Game Miniatures: From Collectibles to Gameplay
Game miniatures have become a central element in the world of tabletop games, bringing to life...
Par Dacey Rankins 2024-12-02 14:45:47 0 7KB

BigMoney.VIP Powered by Hosting Pokrov