Python Program To Display Multiplication Table of Any Number

116

In this Python code tutorial, you will learn how to display the multiplication table of any number. Before moving ahead, please ensure that you have a basic knowledge of the following concepts:

Before moving ahead, you must check these resources for Python beginners:

Other Python code examples you should check:

Python Program To Display Multiplication Table of Any Number

python program to display multiplication table

Let’s now see the code to display the multiplication table of any number.

Code:

numtable = int(input("Enter the number whose multiplication table you want to display: "))

for i in range(1, 11):
   print(numtable, 'x', i, '=', numtable*i)

In this code, we will take input from users and save it numtable variable. After that, we will use the for loop to range between 1 to 10 using the range() function and print the multiplication table of the specified number.

Output:

Enter the number whose multiplication table you want to display: 23
23 x 1 = 23
23 x 2 = 46
23 x 3 = 69
23 x 4 = 92
23 x 5 = 115
23 x 6 = 138
23 x 7 = 161
23 x 8 = 184
23 x 9 = 207
23 x 10 = 230

Must check Python programming tutorials: