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
How Long Do People Stay and What’s the Turnover Rate?
When evaluating a company, one of the most telling indicators of its health and culture is how...
How Salary Ranges Work: Minimum, Midpoint, Maximum, and Pay Bands
How Salary Ranges Work: Minimum, Midpoint, Maximum, and Pay Bands
Salary ranges are one of the...
Golang vs Java
Golang
Launched in 2011, Go or Golang is an open-source language from Google. Similar...
What Software Should I Use for Presentations?
Choosing the right software for presentations is just as important as creating content. The tool...
Who is a Marketing Director, and what do they do?
Who is a CMO and what does he do?
A marketing director is a senior manager who is...