AI Python for Beginners: C1M1 Assignment Module 1

In the very first exercise I have attempted to resolve the error but even when I try defining the “test your code” line I get the error. I’m very lost and have no idea what the red text is trying to tell me to do. Maybe I’m defining it incorrectly? I’ve copy pasted the error below. In my answer I tried defining: "test_your_code.exercise_1a"book_title, author, year_published, available_copies = printbook_title
print author
print year_published
print available_copies

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

NameError: name ‘test_your_code’ is not defined

1 Like

Did you run all of the cells in the notebook starting from the top? You must do this every time you open a notebook.

2 Likes

exactly as Tmosh said, remember to run the import that are libraries, functions, definitions, that let the code work

Dear @Joseph81,

I hope your issue has been resolved. If not, please feel free to direct message me your notebook. I will review it and get back to you with both the problem and the solution.