AI Python for Beginners - Module 2 - Assignment: Book Tracker

I am trying to submit my assignments for Module 2 and running into a grading error:

There was a problem compiling the code from your notebook. Please check that you saved before submitting. Details: unexpected indent

I have restarted from scratch multiple times and even tried to submit the assignment 1 exercise at a time without any luck.

Has anyone seen this error and could help point me in the right direction?

Thanks

“unexpected indent” usually means that you have indented some line of code in a way that the grader does not expect. Python uses indentation to define blocks of code.
Indentation should consistently use the correct number of spaces. Not tabs.

Also, it could mean that you have a line that only contains an open- or closing- parenthesis. This is technically allowed by Python, but the grader doesn’t handle it correctly.

1 Like

Thanks for the suggestions, but I have tried to submit the assignment with nothing in the blocks of code and still get the same error.

Sorry, I don’t exactly understand what that means.

{edited}

What I meant was, I clicked “submit” without actually entering any code or answers and it gave me the same error. If I click submit on another module with nothing, I get an expected answer of:

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

So it looks like the assignment itself may have example code improperly indexed and its not even looking at what I submitted. Either way, I sent you the notebook with “Exercise 1” answered only

Before uploading, I tried one more time submitting 1 exercise at a time and it worked - I am not sure what changed but I got a passing grade now - Thanks

OK, that’s good news.

Typically that sort of issue is due to not saving your work manually before you submit for grading. The auto-save functions don’t work very well.

Maybe that was it, maybe not. Hard to tell.