Submit programming assignment module 2 of course AI Python for Beginners but no score

When creating a post, please add:

  • Module # must be added in the tags option of the post. (ex: Module-1)
  • Module-2
  • Link to the classroom item you are referring to:
    ** Description (include relevant info but please do not post solution code or your entire notebook)
  • I am taking the AI PYTHON for Beginner course and have reached Module 2. I completed the assignment and tested the code successfully. However, after submitting the assignment, my grade has not been updated. Could you please check if there is an issue with your system? I tested the code, and it shows that all tests passed. —> Please check this problem.

(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)

Please click on the > markers in the grader report, and post back some screen capture images of what it says.

(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)

Did you make any of these modifications to your notebook?

  • Add any cells?
  • Delete any cells, and then try to restore them?
  • Move any cells?
  • Modify cells that you were not told to in the instructions?
  • Download the notebook and work on it using some other tools?
  • Rename your notebook?

I didn’t do any of the things you mentioned. I completed the assignment just like in Module 1 by entering the code and running it as instructed. However, I’m confused as to why the test run passed, but I can’t submit the assignment

Most likely the best way to fix this is for you to rename your notebook, then use the Lab Help tool “Get latest version”, and get a fresh copy of the notebook and start over.

Then, be sure you only add code where instructed, and only add the code that is specifically mentioned.

If you have to add extra code to fix an error, you’re doing something wrong.

Hi @KwannateJinny,

Please remember the following:

  1. DO NOT add extra code in the cells. Only implement code which you have been asked to implement.
  2. Run all of the cells in the notebook top to bottom. Do not skip any cells in between.

(All of this and more is covered at the beginning of the notebooks under “Tips…”)

Keeping these two points in mind, from the screenshot I can see that you added the import import test_your_code in your exercise cells. This is not how it should be. The import is a separate cell at the beginning of the notebook, use that and keep it there. In the exercise cells, only implement the exercise, nothing extra.

Best,
Mubsi

P.S Going forward, only share the errors you get in the notebook or front he autograder. Do not publish your solution code publicly. If anyone would want to look at your code, they will direct message you.

Hi Mubsi,

I didn’t know that I couldn’t publish the solution code in the forum. I apologize for that, and going forward, I will only share the errors as you suggested.

I have now followed your advice by removing the unrelated lines and re-running all the cells from the beginning without skipping any. However, I am still encountering issues when submitting the assignment. Could you please provide further guidance? I have attached screenshots of all the code for your reference.

Thank you for your assistance.

Best regards,

Kwannate

(Attachment Assignment Module 2.docx is missing)

Your attachment is missing.

Please do not submit Word files.

Please do not share your code unless a mentors asks you to, and gives you specific instructions.

Dear,

Please see detail from attach file.

{mentor edit: attachment removed}

Dear,

Please use attach file instead.

As I said: Please do not share your code for the assignments.
That is not allowed by the Code of Conduct.

I have removed the attachment from your message.

Currently, exercise 5 is showing this error message, and after I submit the assignment, every question shows this error. Could you please advise on how to fix this or what steps to take next?


Hi @KwannateJinny,

After looking at your notebook, here’s why you are facing this issue:

In exercise 1, you are asked to create a book dictionary using the given key/value pairs:

But what you are doing afterwards is that instead of using this book dictionary variable you created in ex 1 every time you have to use it, you are creating a new book variable in every following exercises, and changing the key/value pairs as you go along.

For example, you did this in exercise 2:

book = {
    'on_shelf': "False",
    'on_hold': "False"
}

And then you did this is exercise 3:

book = {
    "overdue": "True",
    "borrower": "Arthur Dent",
    "on_hold": "False"
}

And so on…

For every exercise, you are overwriting the book variable with key/value pair(s) needed for that particular exercise.

This is why when you have reach the cell and it tries to run book_name = book['title'] you are getting the error KeyError: 'title', because by this time there’s no key/value pair named title in your dictionary.

I’m also seeing that you have added (copy/pasted) code in cells which you were not supposed to do.

Instead of cleaning the mess of the notebook, I’d suggest to get a new copy of this assignment. You can do that by opening the assignment, on the top right you should see Help (?), click it. When the panel opens, click on Get latest version.

When you get the latest assignment version, re-attempt the assignment from scratch by carefully reading and following the instructions of each exercise. Even the code cell comments have straight forward hints provided in them on what to write.

Best,
Mubsi

I have followed all your recommendations. Thank you for your help. I have successfully submitted the assignment now.

1 Like