Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Searching a String | Strings
Python Data Types
course content

Зміст курсу

Python Data Types

Python Data Types

1. Numeric Types
2. Boolean Type
3. Strings

Searching a String

We also have the ability to search for substrings in strings using find() method. This method returns the index of the first occurrence of the substring. If there are no lines, then the function will return -1.

Don't forget Python is case sensitive. So, the first occurrence of the C is 11, and the first occurrence of the c is 2. Since C it is not the same as c.

Завдання

You have such a string

string = "apple, banana, cherry, orange"

You have to find out the index of the first occurence of such substrings as:

a, h, y, Y.

Завдання

You have such a string

string = "apple, banana, cherry, orange"

You have to find out the index of the first occurence of such substrings as:

a, h, y, Y.

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

Секція 3. Розділ 10
toggle bottom row

Searching a String

We also have the ability to search for substrings in strings using find() method. This method returns the index of the first occurrence of the substring. If there are no lines, then the function will return -1.

Don't forget Python is case sensitive. So, the first occurrence of the C is 11, and the first occurrence of the c is 2. Since C it is not the same as c.

Завдання

You have such a string

string = "apple, banana, cherry, orange"

You have to find out the index of the first occurence of such substrings as:

a, h, y, Y.

Завдання

You have such a string

string = "apple, banana, cherry, orange"

You have to find out the index of the first occurence of such substrings as:

a, h, y, Y.

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

Секція 3. Розділ 10
toggle bottom row

Searching a String

We also have the ability to search for substrings in strings using find() method. This method returns the index of the first occurrence of the substring. If there are no lines, then the function will return -1.

Don't forget Python is case sensitive. So, the first occurrence of the C is 11, and the first occurrence of the c is 2. Since C it is not the same as c.

Завдання

You have such a string

string = "apple, banana, cherry, orange"

You have to find out the index of the first occurence of such substrings as:

a, h, y, Y.

Завдання

You have such a string

string = "apple, banana, cherry, orange"

You have to find out the index of the first occurence of such substrings as:

a, h, y, Y.

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

We also have the ability to search for substrings in strings using find() method. This method returns the index of the first occurrence of the substring. If there are no lines, then the function will return -1.

Don't forget Python is case sensitive. So, the first occurrence of the C is 11, and the first occurrence of the c is 2. Since C it is not the same as c.

Завдання

You have such a string

string = "apple, banana, cherry, orange"

You have to find out the index of the first occurence of such substrings as:

a, h, y, Y.

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