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:
lst = [1, 2, 3, 4]
print(lst[-1]) # 4
Let the following list be given:
lst = ['a', 'b', 'c', 'd']
Display the last item in this list.
Modify the previous task to print the second to last item in the list.