# C2w2 assignment - exercise 2

**URL:** <https://community.deeplearning.ai/t/c2w2-assignment-exercise-2/713538>\
**Category:** Source Systems, Data Ingestion, and Pipelines\
**Tags:** week-module-2, coursera-platform\
**Created:** [October 24, 2024, 10:12pm UTC](https://community.deeplearning.ai/t/c2w2-assignment-exercise-2/713538 "2024-10-24T22:12:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajeev\_Prabhakar](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Rajeev\_Prabhakar](https://community.deeplearning.ai/u/Rajeev_Prabhakar)\
**Post date:** [October 24, 2024, 10:12pm UTC](https://community.deeplearning.ai/t/c2w2-assignment-exercise-2/713538/1 "2024-10-24T22:12:29Z")

</div>

For exercise 2, under function definition def paginated\_featured\_playlists.  
where can I find more pointers/documentation / help as to what syntax I need to use here ? I don’t see anything close in the spotify WebAPI documentation ..

# Use extend() method to add the playlist’s items to the list of responses.

```
responses.None(response.None('None').None('None'))
# Get the total number of the elements in playlist and save it in the variable total_elements.
total_elements = response.None('None').None('None')

```

---

<div class="post-metadata">

**Author:** ![Amir\_Zare](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/amir_zare/32/95275_2.png) [@Amir\_Zare](https://community.deeplearning.ai/u/Amir_Zare)\
**Post date:** [October 25, 2024, 10:42am UTC](https://community.deeplearning.ai/t/c2w2-assignment-exercise-2/713538/2 "2024-10-25T10:42:02Z")

</div>

Hello @Rajeev_Prabhakar  
The variable `responses` is a list, and we are supposed to add a bunch of new items to this list using the `extend` method. `extend` is some built-in python function, and this has nothing to do with the Spotify documentation. In order to better understand this function, I suggest you take a look at the following code snippet alongside its outputs.

 ![image](https://global.discourse-cdn.com/dlai/original/3X/6/2/62473129bbce6fad1262f72283c2925ffa7afc2f.png)

---

<div class="post-metadata">

**Author:** ![Rajeev\_Prabhakar](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Rajeev\_Prabhakar](https://community.deeplearning.ai/u/Rajeev_Prabhakar)\
**Post date:** [October 25, 2024, 11:03am UTC](https://community.deeplearning.ai/t/c2w2-assignment-exercise-2/713538/3 "2024-10-25T11:03:28Z")

</div>

Amir - thanks for getting back…I was finally able to figure that  
list extend part last night, but, forgot to update the thread this  
morning…

Do you have any similar code snippet example for the following  
in the function def paginated\_featured\_playlists ?  
“Update the offset value with the current value from the request  
you did plus the limit value.”

---

<div class="post-metadata">

**Author:** ![Amir\_Zare](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/amir_zare/32/95275_2.png) [@Amir\_Zare](https://community.deeplearning.ai/u/Amir_Zare)\
**Post date:** [October 25, 2024, 1:32pm UTC](https://community.deeplearning.ai/t/c2w2-assignment-exercise-2/713538/4 "2024-10-25T13:32:25Z")

</div>

You are welcome @Rajeev_Prabhakar  
I can’t provide the answer, but as you probably know by now, the `response` variable is a dictionary, with `response.get("playlists")` being its inner dictionary. There is a key `offset` inside this inner dictionary that you should get and add the `limit` variable to it.  
Hope this helps clarify the instructions.
