---
id: 68b9e951e4892721632acc26
title: Step 15
challengeType: 20
dashedName: step-15
---

# --description--

Great! Now let's test adding elements to your linked list. At the bottom of your code, after creating an instance of `LinkedList` called `my_list` and printing `my_list.is_empty()`, add `1` and `2` to the list using the `add` method.

Then, print `my_list.is_empty()` again to confirm that the list is no longer empty. Finally, print `my_list.length` to see the current length of the linked list.

# --hints--

You should add `1` to the list using the `add` method.

```js
({
  test: () => assert(
    runPython(`_Node(_code).has_call("my_list.add(1)")`)
  )
})
```

You should add `2` to the list using the `add` method.

```js
({
  test: () => assert(
    runPython(`_Node(_code).has_call("my_list.add(2)")`)
  )
})
```

You should print `my_list.is_empty()`.

```js
({
  test: () => assert(
    runPython(`
      _Node(_code).find_calls("print")[1].is_equivalent("print(my_list.is_empty())")
    `)
  )
})
```

You should print `my_list.length`.

```js
({
  test: () => assert(
    runPython(`
      _Node(_code).find_calls("print")[2].is_equivalent("print(my_list.length)")
    `)
  )
})
```

# --seed--

## --seed-contents--

```py
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

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

--fcc-editable-region--

--fcc-editable-region--
```
