python for on list with index code example
Example 1: python for loop with index
colors = ["red", "green", "blue", "purple"]
for i in range(len(colors)):
print(colors[i])
Example 2: for in list start with index python
for item in some_list[2:]:
# do stuff
#This will start at the third element and iterate to the end.