Python Slice Object

0
12KB

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

Rechercher
Catégories
Lire la suite
Economics
How Does Foreign Aid Affect Economic Development?
How Does Foreign Aid Affect Economic Development? Foreign aid—often referred to as...
Par Leonard Pokrovski 2026-03-13 01:33:42 0 4KB
Социальные проблемы
Китайский квартал. Chinatown. (1974)
Частный детектив Гиттес принимает предложение загадочной богатой красавицы заняться...
Par Nikolai Pokryshkin 2023-03-01 11:11:59 0 25KB
Business
How Can I Provide Effective Feedback?
Delivering Constructive and Actionable Feedback in Professional and Personal Relationships Why...
Par Dacey Rankins 2025-05-27 14:27:36 0 9KB
Almanacs
Almanac
Almanac (fromArabic. ألمناخ—astronomicalcalendar) is a typeof serialpublication, an...
Par FWhoop Xelqua 2022-12-04 17:57:45 0 21KB
Социальные проблемы
Элегия Хиллбилли. Hillbilly Elegy. (2020)
Исследование темы американской мечты на примере трёх поколений одной семьи, живущих в горах...
Par Nikolai Pokryshkin 2022-10-06 22:16:57 0 29KB

BigMoney.VIP Powered by Hosting Pokrov