1number_list = [1, 2, 3]
2print(number_list[-1]) #Gives 3
3
4number_list[-1] = 5 # Set the last element
5print(number_list[-1]) #Gives 5
6
7number_list[-2] = 3 # Set the second to last element
8number_list
9[1, 3, 5]
1>>> some_list = [1, 2, 3]
2>>> some_list[-1] = 5 # Set the last element
3>>> some_list[-2] = 3 # Set the second to last element
4>>> some_list
5[1, 3, 5]