Python Slice Object

0
11KB

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

Suche
Kategorien
Mehr lesen
Телевидение
Христианский телеканал GNC
GNC — Первый Христианский спутниковый телеканал на русском и украинском языках,...
Von Nikolai Pokryshkin 2022-08-30 10:47:57 0 28KB
Pets
Exploring the World of Pet Shopping: From Essentials to Luxuries
Exploring the World of Pet Shopping: From Essentials to Luxuries In recent years, the way we...
Von Leonard Pokrovski 2024-06-01 11:55:21 0 31KB
Food and Related Products
Sushi
Sushi, or sushi (Jap. すし, 寿司, 壽司, 鮨, 鮓, 寿斗, 寿し sushi, [sɯɕi]; Indeclinable), is a dish of...
Von FWhoop Xelqua 2023-04-26 17:00:48 0 18KB
Искусство, культура и развлечения
Я хотел спрятаться. Hidden Away. (2020)
Тони - сын итальянских эмигрантов. После смерти матери его усыновляет немецкоговорящая семья в...
Von Nikolai Pokryshkin 2022-10-01 22:55:42 0 29KB
Business
What Traits or Qualities Define a Great Leader?
Great leaders combine vision, empathy, and strategic thinking to guide teams toward success....
Von Dacey Rankins 2025-08-13 20:13:17 0 3KB

BigMoney.VIP Powered by Hosting Pokrov