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 is the Role of Innovation in Business Strategy?
In today’s competitive business environment, innovation is no longer just a buzzword; it is...
Embracing Internationality: Fostering Global Citizenship Among Kids and Teens
Embracing Internationality: Fostering Global Citizenship Among Kids and Teens
In an increasingly...
My Octopus Teacher (2020)
A filmmaker forges an unusual friendship with an octopus living in a South African kelp forest,...
How Long Does a Viral Campaign Last — and How Sustainable Is It?
Introduction
Viral marketing is often described as lightning in a bottle — brilliant,...
How to make a budget for yourself
What will you learn?
What is budgeting?
What budgeting...