Python Slice Object
Postado 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")
Pesquisar
Categorias
- Arts
- Business
- Computers
- Jogos
- Health
- Início
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia mais
What Books Tell the Story of Risky Financial Deals and Crises from the Inside
What Books Tell the Story of Risky Financial Deals and Crises from the Inside
Few subjects...
Types of market-oriented environmental tools
Key points
The three main categories of market-oriented environmental policies are...
Whiplash. (2014)
A promising young drummer enrolls at a cut-throat music conservatory where his dreams of...
ADHD: Brain structure
The left prefrontal cortex, shown here in blue, is often affected in ADHD.In children with...
Should I Include Personal Information in My Business Biography?
In the professional world, a business biography plays a critical role in presenting who you are...