increment in loop python code example
Example 1: python for loop increment
#you can specify incremental values for for loops in python too!
for x in range(1,10,2):
doSomething(x)
Example 2: python for loop with increment
lis = [1, 2, 3, 4, 5]
for i in range(len(lis)):
print(lis[i])
i+=1
Example 3: python increment by 1
#a = a + 1
a += 1