Python Slice Object

0
11K

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

Site içinde arama yapın
Kategoriler
Read More
Services
20 ideas for business
Medical business is a type of entrepreneurial activity for the provision of services for the...
By FWhoop Xelqua 2022-12-26 14:13:13 0 30K
Programming
History of Python
The programming language Python was conceived in the late 1980s, and its implementation...
By Jesse Thomas 2023-07-24 23:46:08 0 15K
Научная фантастика и фэнтези
Бегущий по лезвию. Blade Runner. (1982)
Ноябрь 2019 года. Бывший охотник на андроидов Рик Декард восстановлен в полиции Лос-Анджелеса для...
By Nikolai Pokryshkin 2023-03-17 14:58:57 0 32K
Financial Services
What is an APR
About APR Technically speaking, APR (annual percentage rate) is a numeric representation...
By Mark Lorenzo 2023-05-23 16:40:26 0 13K
Paranormal
Unveiling the Enigma: Exploring the World of Paranormal Activities
Unveiling the Enigma: Exploring the World of Paranormal Activities Introduction: Paranormal...
By Leonard Pokrovski 2024-06-10 23:00:40 0 18K

BigMoney.VIP Powered by Hosting Pokrov