FAQ: Doubly Linked Lists: Python - Removing by Value I

This community-built FAQ covers the “Removing by Value I” exercise from the lesson “Doubly Linked Lists: Python”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Pass the Technical Interview with Python

FAQs on the exercise Removing by Value I

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in #get-help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to #get-help and #community:tips-and-resources. If you are wanting feedback or inspiration for a project, check out #project.

Looking for motivation to keep learning? Join our wider discussions in #community

Learn more about how to use this guide.

Found a bug? Report it online, or post in #community:Codecademy-Bug-Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Instruction number 2 said:

  1. Create a current_node node and set it equal to the list’s head. Then create a while loop that runs while current_node isn’t None .

Inside the loop, update current_node to be its next node. This is how we will iterate through the list as we look for the matching node.

However, the bold instructions did not get executed even in the solution? setting current_node to be its next_node should be like the following, right?

current_node = set_next_node()

but the solution did not have any code about the “next_node”.

Another problem is, even if i copy-pasted the solution, the terminal still thinks I did something wrong.

Can anyone help me point out what did I do wrong?

1 Like

I can’t believe this is still happening

The method set_next_node() needs its object, but that is not the right method either. What is actually being asked, in order to move the current node forward in the list, is to assign the next node to the current_node variable. In other words get the next node from the current node with the get_next_node() method and assign the result to the current_node variable. If this is still not clear, however, the solution code for 2 happens to be in the hint for 3.