Splitting Strings in Python

splitrsplitpartitionrpartitionjoin
Задание 1

Given a string:

pythontxt = 'a/b/c/d'

Write the code to get the following result:

python['a', 'b', 'c', 'd']
Задание 2

Given a string:

pythontxt = 'a.b.c.d'

Write the code to get the following result:

python['a.b.c', 'd']
Задание 3

Given a string:

pythontxt = 'ab%cd%'

Write the code to get the following result:

python('ab', '%', 'cd%')
Задание 4

Given a string:

pythontxt = '2025-12-31'

Write the code to get the following result:

python('2025-12', '-', '31')
Задание 5

Given a string:

pythontxt = '2025-12-31'

Write the code to get the following result:

python('2025-12', '-', '31')
Задание 6

Given a list:

pythonlst = ['a', 'b', 'c', 'd']

Write the code to get the following string:

python'abcd'
Задание 7

Given a list:

pythonlst = ['2025', '31', '12']

Write the code to get the following string:

python'2025/31/12'
Задание 8

Given a list:

pythonlst = [1, 2, 3]

Write the code to get the following string:

python'123'