By using “For loop” we can create a mathematical table.

The for-loop, written as

By using “For loop” we can create a mathematical table.

The for-loop, written as [initial] [increment] [limit] { … } for initialises an internal variable, executes the body as long as the internal variable is not more than limit (or not less, if increment is negative) and, at the end of each iteration, increments the internal variable. Before each iteration, the value of the internal variable is pushed onto the stack.

We can write a code by using “for loop” as follows.

number= int(input(“enter a number”))

for i in range (1,11,1):

print(number,”*”,i,”=”,number*i)

Output:

mathematical table using For loop

### Like this:

Like Loading...