for loop count python code example
Example 1: python for loop get iteration number
for idx, item in enumerate(list):
print(item)
print('Iteration number: ', idx)
Example 2: for loop example python 3
for num in nums:
for letter in 'abs':
print(num, letter)
Example 3: how to count in a loop python
count=0
for item in list:
print item
count +=1
if count % 10 == 0:
print 'did ten'