How to Loop Through a Set of Code Certain Number of Times in Python


In this example, we will learn how to loop through a set of code a specified number of times and specify an increment value in Python.

Source Code

for i in range(2, 15, 2):
    print(i)

Output:

2
4
6
8
10
12
14

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement