when to use a for loop python code example Example: python for loop for i in range(3): print(i) #prints: 0,1,2