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
Social Issues
Léon: The Professional. (1994)
12-year-old Mathilda is reluctantly taken in by Léon, a professional assassin, after her...
Von Leonard Pokrovski 2022-11-27 18:00:21 0 23KB
Business
What is Bootstrapping in Business?
Bootstrapping is a popular method of building a business from the ground up without relying on...
Von Dacey Rankins 2025-03-28 14:36:44 0 10KB
Financial Services
Explicit and implicit costs and accounting and economic profit
Key points Privately owned firms are motivated to earn profits. Profit is the...
Von Mark Lorenzo 2023-02-23 18:34:44 0 15KB
Central America
Central America Yachts
With such "brands" as the Caribbean Sea and the Panama Canal, Central America, it would seem,...
Von FWhoop Xelqua 2023-03-17 18:15:06 0 22KB
Science Fiction and Fantasy
Back to the Future. (1985)
Marty McFly, a 17-year-old high school student, is accidentally sent 30 years into the past in a...
Von Leonard Pokrovski 2022-11-24 18:54:33 0 33KB

BigMoney.VIP Powered by Hosting Pokrov