xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to loop (iterate) through a range using for loop in Python
Python Online Editor
Execute Code
More Python Sample Codes
# How to loop through a range print("\n Loop through range from a specific number to another") for x in range(1, 10): # print from 1 to 9 and stop at 10 print(x) print("\n Another example") for x in range(30, 40): # print from 30 to 39, where 30 is start and 40 is stop print(x) print("\n Loop through range with specific times") for x in range(10): # loop 10 times from 0 to 9 and stop at 10 print(x) print("\n Loop through a range with increment of 2 each time") for x in range(30, 40, 2): # print 30, 32, 34, 36, 38 and stop at 40 where 2 is the increment for each loop print(x)