Ok, so please explain what each and every line of your code does.
i did just above my previous message you can go through it and let me know if you have any other question.
No. You did not explain. Please explain what each and every line does
Can you explain what you think each of these parameters represent and how they will be used in the function?
EDIT: Also, when you call this function, what would the function call line look like?
If it helps here is the text from step 24 when the function parameters are created
Step 24
The algorithm will start at a specified node. Then it will explore the graph to find the shortest path between the starting node, or source, and all the other nodes.
For that your function needs two parameters:
graph
, andstart
. Add them to your function declaration.
ok but this is the last time the first line tell us about a function which has two parameters graph and start which has an unvisited variable which is added to empty list and a for loop is created so that when we execute the function it will show us what needed to be added to unvisited list.
That is still not an explanation. Stop. Slow down. Actually explain what the parameters mean.
Repeating the same thing after being asked to explain further is not helping us fix your misunderstanding.
anyways i tried it couple of times again and again and the code worked.
thanks for the help all of you guys if required then will get in touch with you guys.
But do you understand what changed and why it is important? You have an important error in your code above. Without understanding, getting the passing step is pretty useless.
I request everyone who thinsg i am not able to understand coding plesae connect me on my discod my username is punitdave so that we can discuss and sort things out
You have demonstrated here that you do not understand your code and have no patience for debugging. This doesn’t mean you cannot understand, just that you do not understand the code you’re writing here. I recommend you slow down and focus on understanding everything you type.
Debugging and understanding are at the heart of professional programming. We don’t have answers to copy. We need to be detectives and investigate our code to ensure it works as requested.
Our questions don’t imply this. There is obviously something you didn’t understand about this step though. It does require a bit of a logical leap about how the function is going to work and what the parameters represent.
I suspect our questions about the code, and the parameters in particular, led you to the solution. This is the goal of the questions, to help focus your attention in a methodical way and think about the code.
The goal isn’t to randomly try different things until it works. Ideally you can use logic and methodical investigation to find the solution. Yes, sometimes that will require multiple tries but you should be able to explain how you solved it better than “i tried again and again and it worked”. This does strongly imply that you do not understand how you solved this step.
if you want to connect on discord with people you could join freecodecamp’s server at chat.freecodecamp.org