Reverse Multiplication Table using For Loop in Python


This program is a simple program that calculates the multiplication table of a given number up to a certain limit. The program prompts the user to enter the number for which they want to generate the table and the limit up to which they want to generate the table.

The program uses a "for" loop with the "range" function to iterate through a range of numbers, starting from the limit entered by the user, and ending at 1. The loop decrements by 1 in each iteration using the -1 as the step argument.

On each iteration of the loop, the current value of the iterator variable "i" is multiplied by the table number entered by the user, and the result is printed to the console. This is done using the print function and the string concatenation operator. The end result is a multiplication table of the given number up to the specified limit, with the numbers in descending order.

Source Code

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

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

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

Output

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