In Python, how do you get the last element of a list?
You can also use the code below, if you do not want to get IndexError when the list is empty.
next(reversed(some_list), None)