Loop to perform operations to remove key to end
while ( current != tail ) : NEW_LINE INDENT if ( current . data == key and prev2 == None ) : NEW_LINE INDENT prev = current NEW_LINE current = current . next NEW_LINE head = current NEW_LINE last . next = prev NEW_LINE last = last . next NEW_LINE last . next = None NEW_LINE prev = None NEW_LINE DEDENT else : NEW_LINE INDENT if ( current . data == key and prev2 != None ) : NEW_LINE INDENT prev = current NEW_LINE current = current . next NEW_LINE prev2 . next = current NEW_LINE last . next = prev NEW_LINE last = last . next NEW_LINE last . next = None NEW_LINE DEDENT elif ( current != tail ) : NEW_LINE INDENT prev2 = current NEW_LINE current = current . next NEW_LINE DEDENT DEDENT DEDENT return head NEW_LINE