![]() |
VOOZH | about |
A multiplication table of any number can be printed using the For loop in Python. We can also print the multiplication table in reverse order using a for loop in Python. In this article, we will see how we can print the multiplication table in reverse order using a for loop in Python.
Example:
Input: TableNumber = 2
Output:
Printing Multiplication Table of 2 in reverse order
10 * 2 = 20
9 * 2 = 18
8 * 2 = 16
7 * 2 = 14
6 * 2 = 12
5 * 2 = 10
4 * 2 = 8
3 * 2 = 6
2 * 2 = 4
1 * 2 = 2
Below are some of the ways by which we can print the multiplication table in reverse order using for loop in Python:
In this example, the code first prompts the user for a number, then prints its multiplication table in reverse order, starting from 10 down to 1.
Output:
Enter the Number of Multiplication Table to Print:
5
Printing Multiplication Table of 5 in Reverse Order:
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
In this example, the code generates the multiplication table of 2 in reverse order. It starts by setting the multiplier to 2, then uses a for loop to iterate through numbers from 10 down to 1. For each number, it multiplies it by the multiplier and prints the result, creating a descending table of multiplication facts for 2.
Output:
10 * 2 = 20
9 * 2 = 18
8 * 2 = 16
7 * 2 = 14
6 * 2 = 12
5 * 2 = 10
4 * 2 = 8
3 * 2 = 6
2 * 2 = 4
1 * 2 = 2