# Exercise 4: Tracking Down the Borrower - STUCK

**URL:** <https://community.deeplearning.ai/t/exercise-4-tracking-down-the-borrower-stuck/888607>\
**Category:** AI Python for Beginners\
**Tags:** week-module-2, dl-ai-learning-platform\
**Created:** [February 10, 2026, 6:01am UTC](https://community.deeplearning.ai/t/exercise-4-tracking-down-the-borrower-stuck/888607 "2026-02-10T06:01:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![agill407](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/agill407/32/123242_2.png) [@agill407](https://community.deeplearning.ai/u/agill407)\
**Post date:** [February 10, 2026, 6:01am UTC](https://community.deeplearning.ai/t/exercise-4-tracking-down-the-borrower-stuck/888607/1 "2026-02-10T06:01:24Z")

</div>

Hi all,

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

```auto
    # Set "borrower_email" equals "borrower['email']"

```

### END CODE HERE

# Print the information

print(f"{book[‘borrower’]}'s email is: {borrower\_email}")

 ![image](https://global.discourse-cdn.com/dlai/original/3X/0/5/052d7e47a1e3c973fafb4c0de470e35da4aff51f.png)

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [February 10, 2026, 7:52am UTC](https://community.deeplearning.ai/t/exercise-4-tracking-down-the-borrower-stuck/888607/2 "2026-02-10T07:52:27Z")

</div>

Hi @agill407,

Please go through these [common mistakes](https://community.deeplearning.ai/t/c1m1-assignment-programming-assignment-working-with-a-virtual-library/756062/2) made by learners.

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:

![Screenshot 2026-02-10 at 12.51.18 PM](https://global.discourse-cdn.com/dlai/original/3X/8/4/843294f21a7a7d159f696455ebf8140082e83133.png)

Best,  
Mubsi

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [February 10, 2026, 4:24pm UTC](https://community.deeplearning.ai/t/exercise-4-tracking-down-the-borrower-stuck/888607/3 "2026-02-10T16:24:50Z")

</div>

Every time you open a notebook, you must run all of the cells starting at the top.

This is because your saved notebook does not include the runtime environment. You must re-create this every time you open the notebook.
