the else part of the algorithm is only executed if the list is not empty the new node' previous variable is set to the tail of the listnew_node prev self tail the tail' next pointer (or variableis set to the new nodeself tail next new_node lastlywe update the tail pointer to point to the new nodeself tail new_node since an append operation increases the number of nodes by onewe increase the counter by oneself count +