Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Advanced Slicing | Basic Concepts
String Manipulation in Python
course content

Зміст курсу

String Manipulation in Python

String Manipulation in Python

1. Basic Concepts
2. String Methods
3. Strings Formatting

Advanced Slicing

There is a more advanced slicing technique that exists. It allows us to extract all the elements in a specific range with a specific step set.

To set this step, we need to put it as the third number after the second colon as follows: s[start:end:step]. Let's consider a simple example: given string s, and we want to understand what will be extracted after the following code execute: s[1:10:2]. This will extract each second element starting from index 1: 1, 3, 5, 7, 9.

Завдання

Given variable course with the string String Manipulation in Python. Extract all the elements from index 5 to index 12 with step 3.

Завдання

Given variable course with the string String Manipulation in Python. Extract all the elements from index 5 to index 12 with step 3.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 5
toggle bottom row

Advanced Slicing

There is a more advanced slicing technique that exists. It allows us to extract all the elements in a specific range with a specific step set.

To set this step, we need to put it as the third number after the second colon as follows: s[start:end:step]. Let's consider a simple example: given string s, and we want to understand what will be extracted after the following code execute: s[1:10:2]. This will extract each second element starting from index 1: 1, 3, 5, 7, 9.

Завдання

Given variable course with the string String Manipulation in Python. Extract all the elements from index 5 to index 12 with step 3.

Завдання

Given variable course with the string String Manipulation in Python. Extract all the elements from index 5 to index 12 with step 3.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 5
toggle bottom row

Advanced Slicing

There is a more advanced slicing technique that exists. It allows us to extract all the elements in a specific range with a specific step set.

To set this step, we need to put it as the third number after the second colon as follows: s[start:end:step]. Let's consider a simple example: given string s, and we want to understand what will be extracted after the following code execute: s[1:10:2]. This will extract each second element starting from index 1: 1, 3, 5, 7, 9.

Завдання

Given variable course with the string String Manipulation in Python. Extract all the elements from index 5 to index 12 with step 3.

Завдання

Given variable course with the string String Manipulation in Python. Extract all the elements from index 5 to index 12 with step 3.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

There is a more advanced slicing technique that exists. It allows us to extract all the elements in a specific range with a specific step set.

To set this step, we need to put it as the third number after the second colon as follows: s[start:end:step]. Let's consider a simple example: given string s, and we want to understand what will be extracted after the following code execute: s[1:10:2]. This will extract each second element starting from index 1: 1, 3, 5, 7, 9.

Завдання

Given variable course with the string String Manipulation in Python. Extract all the elements from index 5 to index 12 with step 3.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 5
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt