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

Cerca
Categorie
Leggi tutto
Robotics
Robotics
Robotics is an applied science that deals with the development of automated technical...
By Michael Pokrovski 2024-03-29 23:20:05 0 29K
Social Issues
Radioactive. (2020)
The incredible true story of Marie Sklodowska-Curie and her Nobel Prize-winning work that changed...
By Leonard Pokrovski 2022-10-28 20:01:10 0 24K
Marketing and Advertising
What Rules or Regulations Apply to Telemarketing Calls? A Complete Guide for Businesses
Introduction Telemarketing can be an incredibly effective channel for reaching customers —...
By Dacey Rankins 2025-11-05 14:43:57 0 3K
Жизненные вопросы
Помни. Memento. (2000)
Леонард Шелби изысканно и дорого одет, ездит на новеньком «Ягуаре», но проживает в...
By Nikolai Pokryshkin 2022-12-12 12:27:43 0 26K
Arts, Culture and Entertainment
Ratatouille. (2007)
A rat who can cook makes an unusual alliance with a young kitchen worker at a famous Paris...
By Leonard Pokrovski 2023-04-18 19:54:59 0 27K

BigMoney.VIP Powered by Hosting Pokrov