Print multiplication table in reverse order in python using while loop
Reverse Multiplication Table using For Loop in PythonSource Codetable = 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 Show
OutputEnter 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
Multiplication Table using While Loop in PythonSource Codetable =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 OutputEnter 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 TableSource Codetable =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 OutputEnter 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:
But I want to reverse it to:
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 Try this:
answered Sep 14, 2015 at 20:57
BrokenBinaryBrokenBinary 7,5733 gold badges44 silver badges53 bronze badges
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
output
answered Dec 3, 2020 at 6:34
Suraj Rao 29.1k11 gold badges95 silver badges100 bronze badges answered Nov 10, 2021 at 14:27
Here's your answer
answered Dec 3, 2021 at 9:36
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
answered Dec 5, 2021 at 9:56
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.
|