here is the implementation of the delete(method may look likedef delete(selfdata)current self tail prev self tail while currentif current data =dataif current =self tailself tail current next elseprev next current next self size - return prev current current current next it should take (nto delete node list search we may also need way to check whether list contains an item this method is fairly easy to implement thanks to the iter(method we previously wrote each pass of the loop compares the current data to the data being searched for if match is foundtrue is returnedor else false is returneddef search(selfdata)for node in self iter()if data =nodereturn true return false clearing list we may want quick way to clear list fortunately for usthis is very simple all we do is clear the pointers head and tail by setting them to nonedef clear(self)""clear the entire list ""self tail none self head none in one fell swoopwe orphan all the nodes at the tail and head pointers of the list this has ripple effect of orphaning all the nodes in between