advanced for loop choose index code example
Example 1: one-line for loop python
[thing for thing in list_of_things]
Example 2: for loop with index python3
colors = ["red", "green", "blue", "purple"]
for i in range(len(colors)):
print(colors[i])