I am trying to complete the Module 1: Basics of AI Python Coding virtual library coding assignment. On the 2nd and 3rd lesson, I am submitting the correct code and I am getting the correct answers, but when I submit for grading, it tells me my answers are incorrect. Does anyone know what I am doing wrong?
What is the detailed feedback from the grader? Please post a screen capture image.
Iâm attaching the various screenshots, all of which show that my code worked and achieved the correct answer. I also included the grading result, which is
(Solution code removed, as posting it publicly is against the honour code of this community, regardless if it is correct or not. You can share the errors you get)
(Solution code removed, as posting it publicly is against the honour code of this community, regardless if it is correct or not. You can share the errors you get)
pretty clearly not from a human.
The grader is an automated testing process.
Tip: Getting the expected results on the notebookâs built-in test cases does not prove your code is perfect. This is because the grader uses a totally different set of tests.
Also, itâs extremely picky about formatting.
Iâm not a mentor for this course, but I noticed that the expected output ends with a âperiodâ character, but your print statements donât include it.
Hopefully a mentor for this course will provide some further suggestions.
Thanks, Tom. I had submitted several versions of my code that at least once had matched the expected outcome exactly. I think I mightâve sent you one that did not. Anyway thank you so much for your insight here and I do hope I can hear from someone about how I can fix this and move on. Thanks again. I appreciate it.
Hi Eduardo,
Please, do not share your code on the forum. That is not allowed by the Code of Conduct.
Hopefully a mentor for this course will be available soon.
I did not initially. I actually didthat today with assignment 1 , and it threw an error code. Thatâs the only one of the three assignments that had previously passed for me. Now Inam 0-3, even though I have submitted all the correct code for all three assignments.
So confusing to me. I have spent more time trying to get my correct code submitted and figure out the technicalities of this process to pass muster than I did
doing the test.
A real distraction from the goal of learning the code. So frustrated.
I really appreciate your help.
Actually I was replying to Eduardo, since you and I are already having a separate conversation.
Hi @Eduardo_Lopez1,
As Tom replied here, this is the solution to your particular error case.
Please follow that and let us know.
Thanks,
Mubsi
Hi @davediehl,
As for your errors. There are several things wrong in the code screenshots you have shared.
Firstly, it is against the honour code of this community to share solution code publicly, even if it is incorrect. You are allowed to share the screenshots of the errors you get. If someone has to take a look at your code, they will send you direct/private message.
I have removed the solution code from your messages.
As for the issues in your notebook. At a quick glimpse, I can see at least two places where the âoriginalâ code cells, which you were expected to implement, are including code lines which were not suppose to be part of it.
For example, in your Exercise 1-A, the original was:
### START CODE HERE ###
# Store the title of the book `Brave New World` as a string
book_title = # Add your code here
# Store the author `Aldous Huxley` of the book as a string
# Add your code here
# Store the year `1932` the book was published as an integer
# Add your code here
# Store the number of available copies `4` of the book as an integer
# Add your code here
### END CODE HERE ###
But I can see that you added a print statement in that cell.
Similarly, in Exercise 2, the original was:
available_copies = 4 ### DO NOT EDIT OR REMOVE THIS CODE LINE
### START CODE HERE ###
# 1. Reduce the number of "available_copies" by a value of 1
available_copies = # Add your code here
# 2. Print the message, confirming the checkout. Use multi-line f-string
# In your print statment, use "book_title" you implemented in exercise 1
# Use "available_copies" you calculated above
print(f"""
# Add your code here
""")
### END CODE HERE ###
But you are redefining and printing things in that cell.
Please remember the following DOs and DONâTs when attempting any of the assignments:
-
The assignments are designed in certain ways and flows with intentional purposes. Since this is a beginner level programming course, the nitty gritty is not covered as to not to overwhelm the learners. So simply follow and implement the exercises as per the instructions. Nothing more, nothing less.
If you donât follow them exactly, your tests will fail. If you omit something which the instructions asked, the tests will fail. You add anything extra which was not part of the instructions, the tests will fail.
-
DO NOT add code that is not part of the instructions.
-
DO NOT redefine variables if the instructions are not asking you to.
-
Always run the notebook from top to bottom whenever you open it.
-
DO NOT create a new notebook and copy/paste your code into it. You are always expected to work in the default notebook that opens up when you open the assignment item.
-
DO NOT rename the notebooks.
-
If the expected print statements are all in a single line, do not print them in multiple lines.
The best thing for you to do is ditch the notebook you are working in and start fresh. To do that, follow these instructions:
- Open the notebook. Once it opens, click on the âthree vertical dotsâ on the right. And click
Restore Original Version:

- A pop up will appear. Click on
Restore Original:
- After clicking it, wait for your browser page to refresh. If it doesnât refresh automatically, manually refresh it.
Once it refreshes, you will have a fresh copy of the notebook. Attempt it again, and remember to follow the exercises instructions for each exercises.
Let me know how it goes.
Thanks,
Mubsi





