in the delete methodthe current variable is set to the head of the list (that isit points to the self head of the lista set of if else statements are then used to search the various parts of the list to find the node with the specified data the head node is searched first since current is pointing at headif current is noneit is presumed that the list has no nodes for search to even begin to find the node to be removedif current is nonenode_deleted false howeverif current (which now points to headcontains the very data being searched forthen self head is set to point to the current next node since there is no node behind head nowself head prev is set to noneelif current data =dataself head current next self head prev none node_deleted true similar strategy is adopted if the node to be removed is located at the tail end of the list this is the third statement that searches for the possibility that the node to be removed might be located at the end of the listelif self tail data =dataself tail self tail prev self tail next none node_deleted true lastlythe algorithm to find and remove node loops through the list of nodes if matching node is foundcurrent' previous node is connected to current' next node after that stepcurrent' next node is connected to previous node of currentelse while currentif current data =datacurrent prev next current next current next prev current prev node_deleted true current current next