for loop increment by 2 python code example
Example 1: python for loop jump by 2
for i in range(0,10,2):
print(i)
Example 2: python for loop with increment
lis = [1, 2, 3, 4, 5]
for i in range(len(lis)):
print(lis[i])
i+=1
for i in range(0,10,2):
print(i)
lis = [1, 2, 3, 4, 5]
for i in range(len(lis)):
print(lis[i])
i+=1