I need to do in Python the same as:
for (i = 0; i < 5; i++) {cout << i;}
but I don\'t know how to use FOR in Python to get the index
The most simple way I would be going for is;
i = -1 for step in my_list: i += 1 print(i) #OR - WE CAN CHANGE THE ORDER OF EXECUTION - SEEMS MORE REASONABLE i = 0 for step in my_list: print(i) #DO SOMETHING THEN INCREASE "i" i += 1