Python Slice Object
Postado 2023-02-27 22:23:14
0
9K
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 a Business Plan?
A business plan is a comprehensive document that outlines the vision, mission, goals, and...
Спасти рядового Райана. Saving Private Ryan. (1998)
Вторая мировая. Капитан Джон Миллер получает тяжелое задание. Вместе с отрядом из восьми человек...
Exploring Health Professions: A Vital Sector of Healthcare
Health professions play a crucial role in ensuring the well-being of individuals and communities...
When Can I Expect to Hear Back?
One of the most common and anxiety-inducing questions from candidates during interviews is,...
Python OverflowError
Raised when the result of an arithmetic operation is too large to be represented. This cannot...