Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get index of list item in loop

ints = [1,2,3,4,'5','6']

for idx, val in enumerate(ints):
    print(idx, val)
#Output
0 1
1 2
2 3
3 4
4 '5'
5 '6'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #index #list #item #loop
ADD COMMENT
Topic
Name
9+3 =