def last_element(some_list): '''Return the last element of some_list''' if len(some_list) == 0: return None else: return some_list[-1] def delete_first(some_list): '''Delete the first element of some_list''' del some_list[0] def list_add(some_list, el): '''Add el to the end of some_list''' some_list.append(el) # The below does NOT do the same thing! # # some_list = some_list + el # # This makes a *copy* of the list and adds to the copy. # The original list (that was passed as the argument) is unchanged.