The range() Function in Python


Use range(start, stop, step) to generate a sequence of numbers, useful in loops.

Source Code

for i in range(0, 10, 2):
    print(i)  # Even numbers from 0 to 8
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments