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

Search
Categories
Read More
Financial Services
The economics of pollution
Key Points Economic production can cause environmental damage. This tradeoff...
By Mark Lorenzo 2023-07-20 18:29:02 0 5K
Business
Effective Radio Advertising: How to Attract the Attention of Listeners
Radio advertising remains one of the most effective ways to get the word out about your product...
By Dacey Rankins 2024-09-18 17:01:00 0 9K
Programming
Bootstrap
How do I add Bootstrap to my page? Adding bootstrap to your page is a fast process, just add the...
By Jesse Thomas 2023-06-21 23:01:17 0 5K
Ужасы
Челюсти. Jaws. (1975)
Действие картины протекает в течение пяти дней — на острове Э́мити, где расположен...
By Nikolai Pokryshkin 2023-04-10 14:35:53 0 18K
Life Issues
Inside Out. (2016)
After young Riley is uprooted from her Midwest life and moved to San Francisco, her emotions -...
By Leonard Pokrovski 2023-03-06 18:28:32 0 10K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov