l = [1,2,3,4,5] last = l[len(l)-1]
Here is what the above code is Doing:
1. We create a list called l.
2. We create a variable called last and set it equal to the last element of the list l.
3. We print the value of last.
l = [1,2,3,4,5] last = l[len(l)-1]
Here is what the above code is Doing:
1. We create a list called l.
2. We create a variable called last and set it equal to the last element of the list l.
3. We print the value of last.