num_observations = len(invoice_ids)
print(num_observations)
My code is correct but still its showing that invoice_ids is not defined. why?
num_observations = len(invoice_ids)
print(num_observations)
My code is correct but still its showing that invoice_ids is not defined. why?
Thanks for your question.
Did you run all the cells prior to the question, invoice_ids are declared in the first cell, if that is not executed then that might explain why you might be getting an undefined error
I think mentor @pallavichakraborty got the key point but just to elaborate a bit more, in our notebooks, the code is split into different cells, and if prior cells are not successfully ran, any later cells that depend on them will not run. Moreover, the jupyter’s kernel may reset everytime we close and reopen the notebook, so the best practice, after opening or reopening a notebook, would be to always run all the cells from the top to the cell you are working on, then finish the work, and then run the cell to make sure any variables defined in earlies cells, such as incoice_ids
, are in the memory.
Cheers,
Raymond
I also had this error. I tried running the prior cells and still kept getting a 0 out of 10 on this one. Eventually (after about 10 tries) it worked. I’m not sure what I did differently, if anything.
Thanks Hannah for reporting this, it would surely be something to check if this is happening for multiple users. We will keep a tab on this
Hi Hannah, and welcome to the Forum! Do you mean you didn’t change any of your code and it just passed after some time? Did you see a grader feedback not found
error? Or was it something else?
Hi Arya, and welcome to the Forum! If you’re still seeing an error. Please post the exact error message returned to you by the grader. Thanks!
Hi Arya, and welcome to the Forum! If you’re still seeing an error. Please post the exact error message returned to you by the grader. Thanks!