FAQ: Graph Search: Python - A Graph Search with Real Depth

This community-built FAQ covers the “A Graph Search with Real Depth” exercise from the lesson “Graph Search: Python”.

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

FAQs on the exercise A Graph Search with Real Depth

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 () 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.

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

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!

Hello, there is something wrong with instruction 1. It says to define dfs with the parameters of (graph, current_vertex, target_value, visited=None) Which i did exactly as it should be but would not let me pass the instruction, attached is a screenshot of what i had before i pressed ‘solution’. It makes me sad that this happens sometimes because it’s encouraging to get the green check of awesomeness.
here is the solutions definition of the function (for comparison)

``````# Build your depth-first search function below:
def dfs(graph, current_vertex, target_value, visited=None):
if visited == None:
visited = []
visited.append(current_vertex)
return visited

print(dfs(None, "bees?", None))
``````

1 Like