Why is my code not working? I’ve been at this problem an hour now ad even the answers I put from ChatGPT is not working..
I even created the variable borrower_email=”arthur.dent@dlailibrary.com” to pass it and the homework still won’t accept it even though I get the right answer now.
START CODE HERE
Iterate through the borrowers_list
Look for ‘borrower’ in borrowers_list
Add your ‘for’ loop here
for borrower in borrowers_list:
if book[‘borrower’] == borrower[‘name’]:
borrower_email == borrower[‘email’]
Check if the name “book[‘borrower’]” equals “borrower[‘name’]”
Add your if statement here
# Set "borrower_email" equals "borrower['email']"
END CODE HERE
Print the information
print(f"{book[‘borrower’]}'s email is: {borrower_email}")
The “second point” applies to your situation here. The NameError: name test_your_code is not defined tells us that you have not ran the very first cell of the notebook which imports this for you.
And since you have been trying for a while, you might have made changes in your notebook which might not be easy to reverse, so I would recommend, once you have read the common mistakes, to start fresh on a blank notebook.
You can do that by opening the notebook and clicking on this option: