Searching Strings in Python

startswithendswithfindindexrfindrindexcountreplace
Задание 1

Given a string:

pythontxt = 'abcdef'

Check if this string starts with 'ac'.

Задание 2

Given a list:

pythonlst = ['12', '13', '14', '15']

Check if its elements start with '1'.

Задание 3

Given a number:

pythonnum = 123456

Check if there is a six at the end.

Задание 4

Given a string:

pythontxt = 'abcdef'

Find the index of the symbol 'c'.

Задание 5

Given a string:

pythontxt = 'ab1cd1ef'

Find the index of the character '1', while searching from the third to the seventh character of the string.

Задание 6

Given a string:

pythontxt = '123453637'

Find the index of the last match of the symbol '3'.

Задание 7

Given a string:

pythontxt = '2025.12.31'

Find the index of the last match of the character '2'.

Задание 8

Given a number:

pythonnum = 24536589

Find out how many fives are in it.

Задание 9

Given a list:

pythonlst = ['abc', 'cde', 'cbb', 'aeb']

Find out how many 'b' symbols are in each of its elements.

Задание 10

Given a string:

pythontxt = 'http1://'

Write the code to get the following result:

pythontxt = ''
Задание 11

Given a string:

pythontxt = 'a.bc.d.ef'

Replace all periods in it with spaces.