python gt index in for cycle

Solutions on MaxInterview for python gt index in for cycle by the best coders in the world

showing results for - "python gt index in for cycle"
Valeria
14 Jul 2020
1my_list = [0,1,2,3,4]
2for idx, val in enumerate(my_list):
3    print('{0}: {1}'.format(idx,val))
4#This will print:
5#0: 0
6#1: 1
7#2: 2
8#...