Build a Linked List - Step 18

Tell us what’s happening:

estoy por terminar el certificado de python y tengo problemas con el codigo en paso 18 y no paso desde ahi me marca error de asignacion de la funcion y no carga que marca error que no aparece la funcion y lo pongo marca igual

Your code so far

# User Editable Region
class LinkedList:
    class Node:
        def __init__(self, element):
            self.element = element
            self.next = None

    def __init__(self):
        self.length = 0
        self.head = None

    def is_empty(self):
        return self.length == 0

    def add(self, element):
        node = self.Node(element)
        if self.is_empty():
            self.head = node
        else:
            current_node = self.head
            while current_node.next is not None:
                current_node = current_node.next
            current_node.next = node
        self.length += 1

    def remove(self, element):
        previous_node = None
        current_node = self.head

        while current_node is not None and current_node.element != element:
            previous_node = current_node
            current_node = current_node.next

        if current_node is None:
            return False

        if previous_node is None:
            self.head = current_node.next
        else:
            previous_node.next = current_node.next

        self.length -= 1
        return True


my_list = LinkedList()
print(my_list.is_empty())

my_list.add(1)
my_list.add(2)
print(my_list.is_empty())
print(my_list.length)

my_list.remove(1)
print(my_list.length)
my_list.remove(2)
print(my_list.length)
# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36

Challenge Information:

Build a Linked List - Step 18

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-linked-list-class/6888fe6c745b6852ed240229.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @jose.eduardo.cetis70,

Were you asked to do this in Step #18?

And why is all of this code in your remove function?

Please understand that if you add or change code you were not asked to add or change in the instructions, the tests will not pass.

Happy coding