Python Slice Object

0
11كيلو بايت

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

البحث
الأقسام
إقرأ المزيد
Телевидение
Прямая трансляция телеканала Ю
«Ю» - молодёжный, женский телеканал. Любовь и романтические отношения, семейная жизнь...
بواسطة Nikolai Pokryshkin 2022-10-01 13:08:51 0 34كيلو بايت
Социальные проблемы
Новый порядок. New Order. (2020)
Роскошная свадьба представителей высшего класса прерывается явлением непрошенных гостей - в...
بواسطة Nikolai Pokryshkin 2022-10-08 20:37:42 0 28كيلو بايت
Business
Business model: what is it and what types are there
Business model: what is it and what types are there Ensuring...
بواسطة Leonard Pokrovski 2024-07-21 23:46:30 0 17كيلو بايت
Marketing and Advertising
How Do I Join or Apply for an Affiliate Program?
Affiliate marketing is one of the most accessible ways to start an online business. Unlike...
بواسطة Dacey Rankins 2025-09-18 16:20:25 0 4كيلو بايت
Social Issues
Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb. (1964)
An insane American general orders a bombing attack on the Soviet Union, triggering a path to...
بواسطة Leonard Pokrovski 2022-12-25 19:47:28 0 24كيلو بايت

BigMoney.VIP Powered by Hosting Pokrov