I want to access the object, i.e. array[i], as well as the interator count, i.
This is what I’m trying:
for i, pinName in allPorts[startIndex:endIndex]:
#do stuff
I get errors further down, just wondering if it’s this part of the code.
New to python here. Cheers.
I guess you rather are looking for:
the
enumerate()builtin takes any list (tuple, iterable, …) and yields tuples of (index, item) with index starting at 0.