Python Slice Object
Veröffentlicht 2023-02-27 22:23:14
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
- Arts
- Business
- Computers
- Spiele
- Health
- Startseite
- Kids and Teens
- Geld
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Mehr lesen
Léon: The Professional. (1994)
12-year-old Mathilda is reluctantly taken in by Léon, a professional assassin, after her...
What is Bootstrapping in Business?
Bootstrapping is a popular method of building a business from the ground up without relying on...
Explicit and implicit costs and accounting and economic profit
Key points
Privately owned firms are motivated to earn profits. Profit is the...
Central America Yachts
With such "brands" as the Caribbean Sea and the Panama Canal, Central America, it would seem,...
Back to the Future. (1985)
Marty McFly, a 17-year-old high school student, is accidentally sent 30 years into the past in a...