How to find last element in array python

>>> some_list = [1, 2, 3]
>>> some_list[-1] = 5 # Set the last element
>>> some_list[-2] = 3 # Set the second to last element
>>> some_list
[1, 3, 5]

Here is what the above code is Doing:
1. We create a list called some_list.
2. We set the last element of some_list to 5.
3. We set the second to last element of some_list to 3.
4. We print out some_list.

The output of the code is:

[1, 3, 5]

Exercise
Set the third element of the list to 4.

some_list = [1, 2, 3]

some_list[-1] = 5
some_list[-2] = 3
some_list[-3] = 4

print(some_list)