Print multiplication table in reverse order in python using while loop

Reverse Multiplication Table using For Loop in Python


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

  • Previous
  • Next

Multiplication Table using While Loop in Python


Source Code

table   =int(input("Enter the table :"))
start   =int(input("Enter the starting number : "))
limit   =int(input("Enter the limit :"))
while(start<=limit):
  print(start,"*",table,"=",start*table)
  start=start+1

To download raw file Click Here

Output

Enter the table :5
Enter the starting number : 1
Enter the limit :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


Reverse Multiplication Table

Source Code

table   =int(input("Enter the table :"))
start   =int(input("Enter the starting number : "))
limit   =int(input("Enter the limit :"))
while(limit>=start):
   print(limit,"*",table,"=",limit*table)
   limit=limit-1

To download raw file Click Here

Output

Enter the table :5
Enter the starting number : 1
Enter the limit :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

I'm having troubling reversing my multiplication table.

This is what I have so far:

def reverseTable(n):
    for row in range(1, n+1):
        print(*("{:3}".format(row*col) for col in range(1, n+1)))

But I want to reverse it to:

25 20 15 10 5
20 16 12 8 4
15 12 9 6 3
10 8 6 4 2

Deduplicator

43.6k6 gold badges62 silver badges110 bronze badges

asked Sep 14, 2015 at 20:42

5

You need to reverse your range so it counts backwards. The range() function accepts 3 parameters, range(start, stop, step) so to count from 10 to 1 you would use range(10, 0, -1)

Try this:

def reverseTable(n):
    for row in range(n, 0, -1):
        print(*("{:3}".format(row*col) for col in range(n, 0, -1)))

answered Sep 14, 2015 at 20:57

Print multiplication table in reverse order in python using while loop

BrokenBinaryBrokenBinary

7,5733 gold badges44 silver badges53 bronze badges

for row in range(9,0,-1):
    print(end="\t")
    for column in range(9,0,-1):
        print(row*column,end="\t ")
    print()

Print multiplication table in reverse order in python using while loop

Tushar

83.6k21 gold badges153 silver badges171 bronze badges

answered Feb 24, 2017 at 6:25

FikirFikir

211 bronze badge

1

reverse multiplication table in python taking value from user

num = int(input("enter the number= "))
i=10
while i>=1:
    print(num,"X",i,"=",num*i)
    i= i-1

output

enter the number= 3
3 X 10 = 30
3 X 9 = 27
3 X 8 = 24
3 X 7 = 21
3 X 6 = 18
3 X 5 = 15
3 X 4 = 12
3 X 3 = 9
3 X 2 = 6
3 X 1 = 3

answered Dec 3, 2020 at 6:34

Print multiplication table in reverse order in python using while loop

num=int(input("enter your table number:   "))
for i in range(10,0,-1):
    print(str(num) + "x" + str(i) + "=" + str(num*i))

Print multiplication table in reverse order in python using while loop

Suraj Rao

29.1k11 gold badges95 silver badges100 bronze badges

answered Nov 10, 2021 at 14:27

Here's your answer

num=int(input("Enter the number"))
for i in range (10,0,-1):
  print(f"{num}*{i}={num*i}")

Print multiplication table in reverse order in python using while loop

answered Dec 3, 2021 at 9:36

num = int(input("enter a no.")) 

count = 10 

while count >= 1:
    X = num*count
    print(num, "x", count, "=", X)
    count = count - 1

Tomerikoo

16.6k15 gold badges37 silver badges54 bronze badges

answered Sep 27, 2021 at 7:54

1

i used this i dont know if it is of any help to you since I am a beginner and have just started learning python

    num= int(input("please enter the  number: "))
    n= 11
    for i in range(0,10):
     n -= 1
     print(f"{num} x {n} = {num*n} ")

answered Dec 5, 2021 at 9:56

Print multiplication table in reverse order in python using while loop

How do you print numbers in reverse order in Python while loop?

Reverse Number In Python.
# Python Program to Reverse a Number using While loop..
Number = int(input("Please Enter any Number: ")).
Reverse = 0..
while(Number > 0):.
Reminder = Number %10..
Reverse = (Reverse *10) + Reminder..
Number = Number //10..
print("\n Reverse of entered number is = %d" %Reverse).

How do you make a while loop in Python using multiplication tables?

Method 2: By using While Loop.
number = int(input ("Enter the number of which the user wants to print the multiplication table: ")).
count = 1..
# we are using while loop for iterating the multiplication 10 times..
print ("The Multiplication Table of: ", number).
while count <= 10:.
number = number * 1..

How do you invert a table in Python?

Here, we are going to reverse an array in Python built with the NumPy module..
Using flip() Method. The flip() method in the NumPy module reverses the order of a NumPy array and returns the NumPy array object. ... .
Using flipud() Method. ... .
Using Simple Slicing..

How do you reverse the order of a list in Python?

In Python, there is a built-in function called reverse() that is used to reverse the list. This is a simple and quick way to reverse a list that requires little memory. Syntax- list_name. reverse() Here, list_name means you have to write the name of the list which has to be reversed.