Here we have provided a python program that asks the user to enter a number and its multiplication table.
Prerequisite Topic to Create Print table in Python
- Python Input, Output
- Python Data types
- Python Type Conversion
- Python For loop
- Python Arithmetic Operator
- First, we will ask the user to enter a number
- Using the int() function we will convert the entered number into an integer value.
- Using the for loop and multiplication operator we print the table of the entered number.
Python Program to Display the multiplication Table
Print Table in Python Program
num =int(input("Enter a Number: "))
for i in range(1,11):
print(num,"x",i,"=",num*i )
Output 1:
Enter a Number: 30
30 x 1 = 30
30 x 2 = 60
30 x 3 = 90
30 x 4 = 120
30 x 5 = 150
30 x 6 = 180
30 x 7 = 210
30 x 8 = 240
30 x 9 = 270
30 x 10 = 300
Output 2:
???????Enter a Number: 17
17 x 1 = 17
17 x 2 = 34
17 x 3 = 51
17 x 4 = 68
17 x 5 = 85
17 x 6 = 102
17 x 7 = 119
17 x 8 = 136
17 x 9 = 153
17 x 10 = 170
People are also reading:
- WAP in C++ and Python to calculate 3X3 Matrix multiplication
- Python Program to find Hash of File
- WAP to check whether a given character is an alphabet, digit or any special character
- Python Program to Add Two Matrices
- WAP in C++ & Python to reverse a number
- Python Program to Find Sum of Natural Numbers Using Recursion
- WAP in C++ & Python to calculate the size of each data types
- WAP to calculate the Factorial of an Integer
Leave a Comment on this Post