we adopt new convention where self head points to the beginner node of the list and self tail points to the latest node added to the list this is contrary to the convention we used in the singly linked list there are no fixed rules as to the naming of the head and tail node pointers doubly linked lists also need to provide functions that return the size of the listinserts into the listand also deletes nodes from the list we will be examining some of the code to do this let' commence with the append operation append operation during an append operationit is important to check whether the head is none if it is noneit means that the list is empty and should have the head set pointing to the justcreated node the tail of the list is also pointed at the new node through the head by the end of these series of stepshead and tail will now be pointing to the same nodedef append(selfdata)""append an item to the list ""new_node node(datanonenoneif self head is noneself head new_node self tail self head elsenew_node prev self tail self tail next new_node self tail new_node self count + the following diagram illustrates the head and tail pointers of the doubly linked list when new node is added to an empty list