Can anyone tell me how can I call for indexes in a nested list?
Generally I just write:
for i in range(len(list))
but what if I have a list with nested lists as below:
Nlist = [[2, 2, 2], [3, 3, 3], [4, 4, 4], ...]
and I want to go through the indexes of each one separately?
If you really need the indices you can just do what you said again for the inner list:
But it is more pythonic to iterate through the list itself:
If you really need the indices you can also use
enumerate: