FAQ: Graphs: Python - Refactoring Path-Finding

This community-built FAQ covers the “Refactoring Path-Finding” exercise from the lesson “Graphs: Python”.

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

Computer Science

Complex Data Structures

FAQs on the exercise Refactoring Path-Finding

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!

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

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

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!

Assignment 2 says:

Replace the commented code after we declare current_vertex . Set the key of the current_vertex as True in our seen dictionary.

Should that be: “Set the value of the current_vertex as True in our seen dictionary.”? Or am I missing something here?

1 Like

You have it correct. The dictionary is seen, a key is current_vertex, and the associated value is True.

3 Likes

It is February 29, 2020 and the text still erroneously reads as follows.
Replace the commented code after we declare current_vertex . Set the key of the current_vertex as True in our seen dictionary.

Was there any reason for using a dictionary and not a list for the ‘seen’ variable? I tried it with the list and it gave me the same result, and I can’t think of any reasons it wouldn’t in other circumstances. It seems a lot easier to just use a list, am I missing something?