Python Slice Object

0
7K

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

Pesquisar
Categorias
Leia Mais
Социальные проблемы
Капоне. Лицо со шрамом. Capone. (2020)
Вернувшись из тюрьмы, Аль Капоне продолжает оставаться предметом пристального внимания ФБР. Ведь...
Por Nikolai Pokryshkin 2022-10-17 20:59:18 0 23K
Television
The Evolution of Television: A Cultural Revolution in Pictures and Sound
Television has become one of the most influential inventions in modern history, shaping not only...
Por Dacey Rankins 2024-11-05 15:40:04 0 4K
Жизненные вопросы
Во имя отца. In the Name of the Father. (1993)
Эта драма основана на реальных событиях - истории «Гилфордской четверки». В 1975 году...
Por Nikolai Pokryshkin 2023-03-27 12:21:56 0 21K
Healthcare
The Evolution and Importance of Healthcare: Ensuring Well-Being for All
Healthcare is a fundamental pillar of society, crucial not only for individual well-being but...
Por Dacey Rankins 2024-11-25 15:22:50 0 5K
Philanthropy
Understanding Philanthropy: The Art of Giving Back
Understanding Philanthropy: The Art of Giving Back In a world often marked by division and...
Por Leonard Pokrovski 2024-06-11 23:14:47 0 11K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov