I have a list of lists containing information about smartphone applications. Each list (within the list) contains the same type of information, in the same order.
[id, name, ..., ]
.
The list of lists looks like this: [[id1, name1,...], [id2, name2, ...]]
I want to access the 10th index in each list and check its value.
I tried this, but it does not work. I imagined this would iterate over every list, except the first which is a header, and would select the 10th item in each list.
for c_rating in apps_data[1:][10]:
print(c_rating)
Instead, it prints out every item within the 10th list.
The given solution is:
for row in apps_data[1:]:
c_rating = row[10]
print(c_rating)
I understand why this code works. It breaks the process into two steps. I don't understand why the first code does not work. Any help would be appreciated.