Multiplication Table using For Loop in Python


This program prompts the user to enter a value for the table and a limit. The table is multiplied by all numbers from 1 to the limit entered by the user. The result of each multiplication is printed to the console. The for loop iterates over the range of numbers from 1 to the limit entered by the user, and the i variable is used to represent the current number in the loop. The i variable is then used to calculate the product of the table and the current number in the loop, and the result is printed to the console.

Source Code

table = int(input("Enter the table: "))

limit = int(input("Enter the ending : "))

for i in range(1,limit+1):
    print(i,"*",table,"=",i*table)
    
To download raw file Click Here

Output

Enter the table: 5
Enter the ending : 10
1 * 5 = 5
2 * 5 = 10
3 * 5 = 15
4 * 5 = 20
5 * 5 = 25
6 * 5 = 30
7 * 5 = 35
8 * 5 = 40
9 * 5 = 45
10 * 5 = 50