When i submit the assignment is goes under compilation error in grader but it is working fine when i am using it
There are a couple of things to check here. One easy experiment to run is:
- Kernel → Restart and Clear Output
- Save
- Submit
And see if that helps. The point is that the grader doesn’t need to see the output of your functions in the notebook: it only needs to call your functions. But sometimes the output can be pretty voluminous and may cause syntax issues.
If that doesn’t help, then please show us a screen shot of what it says under “Show grader output”. That doesn’t always help, but sometimes there’s a clue there.
The high level point is that just passing the test cases in the notebook is never a guarantee that you’ll pass the grader. There are lots of ways you can write the code that are not “general”: e.g. referencing global variables from the local scope of your functions instead of the parameters that are being passed in.