Python Program to Generate Multiplication Table

In this Python program, you will learn how to use loops in python to generate and display multiplication table of a given number.

How to Generate and Display Multiplication Table in Python?

# Author : Abundantcode.com
# Python Program to generate and display multiplication table

input = 8

for index in range(1, 11):
   print(input, 'x', index, '=', input*index)

Output

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 the above python program, we have used the for loop with the range method to navigate and iterate 10 times and perform the multiplication of the index with the input and display the result.