Last element of a list in Python
The last element of a list can be obtained in the same way as the last character of a string:
pythonlst = [1, 2, 3, 4]
print(lst[-1]) # 4
Задание 1
Let the following list be given:
pythonlst = ['a', 'b', 'c', 'd']
Display the last item in this list.
Задание 2
Modify the previous task to print the second to last item in the list.