I don't get the output of my code when I run it

Write a detailed description of your issue.

As I complete and run each exercise, I only see the expected output, but I don’t see the output from my own code, is this right?

Also, when I submit my assignment, I am graded 0, with the message

“There was a problem compiling the code from your notebook, please check that you saved before submitting. Details: invalid syntax (, line 19)”

When I go to line 19, I can’t really figure out the issue

(I’m not a mentor for this course. Here are some general tips)

Click on the cell that contains the comment “Test your code!”, and then click the “Run” button in the main toolbar.
The [*] next to that cell means you haven’t run that cell yet.

“Line 19” refers to the line of code in the script that the grader uses - not to your notebook. So the message isn’t that useful, except for the “invalid syntax” part.

Somewhere in your notebook, you have a line that the grader doesn’t like.
Sometimes this can be as simple as putting a closing parenthesis ‘)’ on a line by itself.

An isolated closing parenthesis is fine by Python standards, but the grader tends to not like it.

Many thanks for the prompt response.

I did notice the * as well after running each cell. I have however tried running by clicking the “Run” button and the “Shift+Enter” key.

The below is what I get after running.

That cell doesn’t generate any output, it just imports the “test_your_code” module.
But after you run that cell, it should have a number inside the square brackets.

Many thanks TMosh for your help.

I had to refresh or start over again. Runs properly now and issue solved.

1 Like