I am new here. I was trying the extra exercises in week 1 of AI Python for Beginners. I was getting the error message “print_llm_response” is not a built-in function. The code did run on my AI platform - Google Gemini.
Just want to know if I was doing something wrong here.
I ma having the same problem with Week 2 Assignment. Pls see below the error message I got
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In [5], line 2
1 # Test your code!
----> 2 test_your_code.exercise_1a(book_title, author, year_published, available_copies)
NameError: name 'available_copies' is not defined
I ran the same code in my AI platform - Google Gemini - and the code ran well.
Will greatly appreciate your help on how to fix this problem for me to be able to proceed. I cannot see any set of instructions on how to download the all of the assets that the assignment uses. How do I alos check if the version of my AI tools matches the ones that DL.AI used in creating the assignment.
Regarding your specific error with “available_copies”, I have not yet attempted this course myself, but I’ll take a run at it later this evening. I might be able to give an answer later.
You very likely did not use the variable name available_copies, in the previous cell. Please ensure you using available_copies . Or maybe check if you made a typo in the previous cell when initialising this variable.
Another possibility is that you simply didn’t execute the cell that defines available_copies. You need to run every previous cell first. And note that you need to rerun them anytime you reopen or restart the notebook. If you just leave it open for more than single digit minutes, the “kernel” shuts down and you need to restart the notebook and rerun all the cells.
Hi @paulinpaloalto thanks a lot. I did as you you suggested but the code did not run. I reset my notebook and started all over again and the code now ran. Thanks a lot for all your help. Greatly appreciate it.