I have this slicing problem since 2 days ago and I have tried to look for solution about this matter too since 2 days ago. It keeps giving me Typeerror and I have tried many things (star from beginning, run all cells, copy other people solution, go back to the theories) and didnt give me the result I wanted, which is this one : ([‘August 19, 1971’, ‘Santa Martha Acatitla’, ‘Mexico’, ‘Yes’, ‘Joel David Kaplan Carlos Antonio Contreras Castro’])
For indexing, for example data, you’ll need to use integer in square brackets like so data.
Here’s what’s happening in your code:
index =  #  is not the 0 integer; it is a list containing one 0 integer
for row in data:
# what's happening here is data[index] is equivalent to data[] and not data
# hence, the error you're getting
data[index] = row[:5]
# this can be problematic as well; it is equivalent to index =  + 1 and not index = 0 + 1
index += 1
Can you clarify this? I’m quite bad at reading things.
The for loop that you have loops over all list within data.
In the first iteration, the loop assigns the first list in data to row. It then takes the first five elements within row and assign it to data. This means that if you have six elements inside row, it will ignore the sixth element which is at the same time the last element. Once that’s done, index is incremented and the loop starts the second iteration which assigns the second list in data to row.
You don’t need the loop if you only want one list from data. The for loop is only needed to transform all lists within data from a list with six elements to a list with only five elements. The list with only five elements has everything except the Details info.
I’m not sure if I explained things properly; feel free to ask questions or if I made mistakes somewhere.
But I am still confused on how to write it right because I already followed the instruction and even copied the solution from other people.
And I feel like I understand but I dont know how to start (thats my problem! )
I even still confused with which one is iteration and iterable!
N.B : I am myself not an english native speaker so when take this course I try my hardest to understand.
index =  # it should be index = 0
for row in data:
data[-1] = row[:5]
index += 1
Just change  to 0.
Before this, when it sees index += 1, it actually thinks you want to combine  with 1 which is not possible. What you really need is to add 0 to 1 for example, which is the addition of two numbers together.
The , is a list that we can iterate over for example in a for loop. That’s one reason it’s also called an iterable (aka iterate-able). A list can combine with another list e.g.  +  = [0, 1].