Hi! I’ve been going through the computer science course (Linked Lists) in python and couldn’t quite wrap my head around on why my code was different from the code given in the solution.

This is my code:

```
else:
while current_node:
current_node = current_node.get_next_node()
if current_node.get_value() == value_to_remove:
current_node.set_next_node(current_node.get_next_node())
current_node = None
else:
current_node = current_node.get_next_node()
```

and here is the solution code:

```
else:
while current_node:
next_node = current_node.get_next_node()
if next_node.get_value() == value_to_remove:
current_node.set_next_node(next_node.get_next_node())
current_node = None
else:
current_node = next_node
```

Wouldn’t the next_node be equivalent to the current_node if current_node is set to current_node.get_next_node()? The error message that pops up is:

Does your

`else`

case traverse the list and remove the node with a value of`value_to_remove`

?

Thanks so much in advance.