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

Cerca
Categorie
Leggi tutto
Жизненные вопросы
Золотая лихорадка. The Gold Rush. (1925)
История о злоключениях извечного любимца публики, маленького бродяги, который на этот раз...
By Nikolai Pokryshkin 2023-03-17 15:22:14 0 12K
Financial Services
Elasticity in the long run and short run
Key points In the market for goods and services, quantity supplied and quantity...
By Mark Lorenzo 2023-07-05 20:15:28 0 5K
Business
How to Create a Strong B2B Value Proposition
Attention spans around the world are shrinking due to the sheer amount of information we have to...
By Dacey Rankins 2024-09-24 13:59:14 0 9K
Comics
Comics
To help beginners, we publish a list of terms that are used by experienced comic book readers....
By FWhoop Xelqua 2023-06-29 19:58:06 0 21K
Социальные проблемы
Выжившая. Кровь и металл. Spare Parts. (2020)
После не особо удачного концерта участниц панк-группы похищают неизвестные, ампутируют им руки и...
By Nikolai Pokryshkin 2022-10-16 19:01:18 0 24K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov