Python Slice Object
Postado 2023-02-27 22:23:14
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")
Pesquisar
Categorias
- Arts
- Business
- Computers
- Jogos
- Health
- Início
- Kids and Teens
- Money
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia mais
What Does an Office Administrator Do Daily?
An office administrator plays a central role in keeping an organization running smoothly. Their...
Avengers: Endgame. (2019)
After the devastating events of Avengers: Infinity War (2018), the universe is in ruins. With the...
What Does a PR Professional Do? Roles, Skills, and Impact Explained
Introduction: The Unsung Heroes of Brand Reputation
Every successful brand has one thing in...
The Pianist. (2002)
A Polish Jewish musician struggles to survive the destruction of the Warsaw ghetto of World War...
How to Identify and Qualify New Business Development Opportunities or Partnerships
Business development lives and dies by the opportunities you choose to pursue. Some organizations...