Python Finding Multiplication Table

pyhton-multiplication-table-ipcisco.com

In Python programming, practicing is very important. In this basic python example, we will focus on Python Multiplication Table. We will learn how to print multiplication table with the help of python programming. This is also one of the basic practices of different programming languages.

 

The basic multiplication table consist of the result of 10 numbers multiple by 10 numbers. Here, we will print only one of them. The user will give the input and according to this input, the multiplication schema will be printed.

 

Below, you can find the code for Python Multiplication Table. In this code, we will firstly get the number from the user and then, we will print this number with the number from 1 to 10.

 

num = int(input("Multiplication Table of "))
for i in range(1, 11):
   print(num, 'x', i, '=', num*i)

 

If user write 5, the result of this python code will be:

Multiplication Table of 5
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50

 

 

pyhton-finding-multiplication-table-ipcisco

 

Now, let’s print another number’s multiplication table. This can be 8 this time.

 

num = int(input("Multiplication Table of "))
for i in range(1, 11):
   print(num, 'x', i, '=', num*i)

 

Multiplication Table of 8
8 x 1 = 8
8 x 2 = 16
8 x 3 = 24
8 x 4 = 32
8 x 5 = 40
8 x 6 = 48
8 x 7 = 56
8 x 8 = 64
8 x 9 = 72
8 x 10 = 80

 

In this basic python finding multiplication table example, we have found the multiplication table of a given number. Finding multiplication table with python is one of the basic practice examples of python. You can follow our  other examples to practice on python programming more.

 

Back to: Python Programming Course > Basic Python Examples

Leave a Reply

Your email address will not be published. Required fields are marked *

Python Programming Course

Collapse
Expand