However it is defined - even before it is called, and my code meets expected output.
Error is only called out in cell 11: ‘can’t compile the student’s code’)
Clearly, system can’t compile. I can not only compile, it runs without errors.
Any ideas? /thx
welcome back …
There are an return variable called total_cost you want to equal it by the cost you computed …as this function(compute_cost) return the total_cost
Sounds like maybe you used a global variable inside your function.
The global variables in the notebook are not available when your code is graded. So, check if your code uses any global variables.
Thank you- what you say is quite likely. I’ll make sure any globals are replaced with locals.
Yes. I see that within compute_cost() you compute the cost variable, and locally define total_cost within the function and both cost and total_cost must contain the same value, but total_cost is to be returned. I’ll take a look. Thank you!
Hello TMosh -
Now I have checked that I am using only a locally defined total_cost and it is returned by the function. I still get the same error. Is it possible that there is a typo somewhere and only the system picks it up, but for some reason running the code within the tool the typo is overlooked… Not likely.
another more likely idea… maybe the process I’m using to save changed code and submit it is not correct. what I do is edit the opened file, save to /slm_7 (name varies) then hit submit.
If this is correct, and system is picking up /slm_7, the code I just edited and saved and is working- would there be anything else that might cause this error to be thrown no matter what I do?
thank you - I’m on day 6 of this conundrum. it is beyond frustrating, so anything you can suggest is appreciated. It looks like I have working code and understand the material presented. Its just the toolset that is funky. Anyway - thank you !
Do not change the name of the notebook. This is because the grader always checks the notebook file with the original default file name, regardless of the name of the notebook that you have open.
that would be the problem, I think.
Leaving these questions to be answered:
What is the correct syntax when you save a notebook ( I save to /slm_n (where n increments)
I open the /slm_n I want to edit at each session and save it to the next /slm_n, then hit submit.
What version is being submitted if not the one that I’m editing?
I recommend you never change the name of a notebook. Instead you can use “save and checkpoint”.
The version that is submitted is always the original notebook name. That’s what the grader is programmed to look for.