Reversing a Sequence in Python
To reverse all elements of a sequence, specify a step with a negative value:
pythontxt = '123456789'
res = txt[::-1]
print(res) # '987654321'
Задание 1
Given a string:
pythontxt = '12345'
Turn it over:
python'54321'
Задание 2
Given a list:
pythonlst = ['c', 'b', 'a']
Turn it over:
python['a', 'b', 'c']
Задание 3
Given a string:
pythontxt = '123456789'
Get a slice of all its symbols at even positions in reverse order:
python'8642'