I need help with assignmen 1a

Please add a tag indicating where you are taking the course. Choose only one of the platform options in the tag section then add the week/module.

Store the author Aldous Huxley of the book as a string

author = “Aldous Huxley”

NameError                                 Traceback (most recent call last)
Cell In [55], line 2
      1 # Test your code!
----> 2 test_your_code.exercise_1a(book_title, author, year_published, available_copies)

NameError: name 'author' is not defined

I keep getting an error message. what am i doing wrong

Hi @remi1 ,

You need to run your code from the start of the notebook and keep running code cells in order of sequence. Please bear in mind that the notebook may not have auto save activated, be sure to save your work every time you finish coding a code cell.

If you run into problem and wanted to re-run you code in a clean state:

From the menu bar at the top of your notebook:
Kernel ->restart & clear all output
Cell → run all above (from your current cell)

Thank you, i will try that

I tried but this error message is

Failed test case:

There was no output for exercise 1b cell, check that you run it.
Grader expected: An output generated from print statements
You got: None showing up,

From this error message, it looks like you might not have run the cell of code involving print statements, which is right before the cell “test_your_code.exercise_1b()”. As @Kic suggested, you could do:

Kernel ->restart & clear all output

Cell → run all above (from the cell test_your_code.exercise_1b, to run all cells above this in order, from top to bottom).

Alternatively, after “Kernel ->restart & clear all output”, you could manually run all cells one by one in order, starting from “import test_your_code” until you reach test_your_code.exercise_1b.

Subject: Grader Error in Exercise 1b — KeyError: ‘text’
Message:
Hi team,
I’m encountering a persistent error when running the grader for Exercise 1b in the notebook. My code runs correctly and prints the expected output:

Title: Brave New World
Author: Aldous Huxley
Published: 1932
Available Copies: 4

However, when I run , I get the following traceback: this is what i get, KeyError: ‘text’

I’ve already tried the following:
• Restarting the kernel and clearing all outputs
• Running all cells in order from top to bottom
• Ensuring the print statements are active and correctly formatted
• Running the notebook in the original Coursera environment
Despite this, the grader still fails with “You got: None” and throws the KeyError. It seems like the grader is unable to read the output from the previous cell.
Could you please advise or check if there’s an issue with the grader setup?
Thanks so much!

Hi @remi1 ,

It looks like there is a problem in generating the output when testing your code. Please check your inbox for a message from me.

Hi @remi1,

Please make sure that the notebook you are working in is named C1M1_Assignment.ipynb

Thanks, i got it done