Python changing last elements of list

Solution 1:

You can use for loop for this. And you can access the last elements by using -1 as index values.