In Python, how do you get the last element of a list?
You can also do:
alist.pop()
It depends on what you want to do with your list because the pop() method will delete the last element.
pop()