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

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

Default image
admin
Articles: 38790

Quick Quote

QUICK QUOTE

Approximately 250 words