How to get a list elements index in for loop with Python

1 Answer

0 votes
lst = [23, 45, 76, 198, 203, 893]
     
for i, val in enumerate(lst):
    print(i, val)
    
    
   
'''
run:
 
0 23
1 45
2 76
3 198
4 203
5 893

'''

 



answered May 21, 2019 by avibootz

Related questions

...