C2_W2_Assignment Exercise 2 & 3 Instructions not Sufficient

For example, one of exercise 2’s instruction:

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

responses.None(response.None('None').None('None'))

I have absolutely no idea what the instruction is talking about.
Do we need to be Spotify API expert and Python expert in order to do the lab?
There are serious quality issues about the labs lately.

Most of the posts on this board just talk about how the labs were not working properly.
None discusses the content of the lab.

Hello @hungng777
Sorry for the instructions not being clear enough. You can always post the issues you face here, and we will try our best to help you with the labs.
In this case responses is a list and we want to add a new list of items to it. We can do so by calling the extend method on the original list. for instance, if list1 = [1, 2, 3] and list2 = [4, 5], if we run list1.extend(list2) and print list1, we will get the following:
image
Hope this helps.

Thank you for the discussion of the extend() method. But I was more interested in the statement “response.None(‘None’).None(‘None’).”

I have finally figured out the answer is “response.get(‘playlists’).get(‘items’).”

But I have another question. I don’t understand the following comment.
Could you elaborate? Thanks in advance

Update the offset value with the current value from the request you did plus the limit value.

    offset = response.None('None').None('None') + None

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