C2w2 assignment - exercise 2

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')

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.

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.”

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.

1 Like