If I have a for loop using a range like this:
for x in range(10):
then in order to get the count, it's just x. But say I have a for loop using a list:
layer = [somedata,someotherdata...etc]
for row in layer:
print #the number the loop is on
Is there a way to do this besides specifying an integer count variable and incrementing it each run through, like this?
layer = [somedata]
count = 0
for row in layer:
print count
count += 1