Learn Dedaandsons


Python: for loop with syntex and easy example of 0 to 9 number series.

how to print number series in python with the use of for loop for beginners. | learn python for free with examples for beginners.

Here's the syntax of the for loop in Python:

for variable_name in sequence: statements

here's an example of the for loop in python:

for mak in range(10):


OP: 0 1 2 3 4 5 6 7 8 9

Explanation for the program:

After defining the for loop in the first line we have used a variable called "mak" (you can choose any other name.) Learn more about variable and data types

The in keyword is used to specify the sequence that will be iterated over. The sequence can be a list, a tuple, a range, or any other iterable object. The statements block is executed for each item in the sequence. In the statements block we have used the Python print() function is an output statement.

The program will run 10 times (as given in the range), you will see a output of number series from 0 to 9.


This tutorial may have been created with the assistance of artificial intelligence (AI) tools. Some of the research data used to write this tutorial may have been derived by AI tools, and then put together by humans. Additionally, AI tools may have been used to write some or all of the tutorial.


Move Back to Top

Like, share, follow us.