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
Business
How to Run a Successful Business in Today's Environment
How to Run a Successful Business in Today's Environment In a fast-paced market and increasing...
Von Leonard Pokrovski 2024-08-03 21:47:02 0 20KB
История
Паровоз Генерал. The General. (1926)
Юного Джонни Грэя в армию Конфедерации не взяли, а его возлюбленная Аннабел Ли отвергает его,...
Von Nikolai Pokryshkin 2023-03-26 14:24:04 0 26KB
Business
What Are My Core Values, Strengths, and Weaknesses?
One of the most powerful steps in self-discovery is identifying your core values, strengths, and...
Von Dacey Rankins 2025-09-08 08:06:21 0 3KB
Geschichte
Judgment at Nuremberg. (1961)
In 1948, an American court in occupied Germany tries four Nazis judged for war crimes. My Link
Von Leonard Pokrovski 2023-02-10 14:26:49 0 22KB
Социальные проблемы
Великий диктатор. The Great Dictator. (1940)
Главный герой фильма, еврейский цирюльник, сражается в рядах армии своего государства Томании....
Von Nikolai Pokryshkin 2022-12-19 17:41:28 0 30KB

BigMoney.VIP Powered by Hosting Pokrov