For Loop Example Programs


Range(Stop)

Source Code

for i in range(10):
print(i)
To download raw file Click Here

Output

0
1
2
3
4
5
6
7
8
9

Range(Start,Stop)

Source Code

for i in range(1,10):
   print(i)
To download raw file Click Here

Output

1
2
3
4
5
6
7
8
9

Range(Start,Stop,Step)

Source Code

for i in range(1,10,2):
   print(i)
To download raw file Click Here

Output

1
3
5
7
9