To print multiplication table of any number in python, you have to first ask from user to enter the number and start calculating its table to print the multiplication table of the given number as shown in the program given below.
Following python program ask from user to enter a number and prints multiplication table of that number:
# Python Program - Print Multiplication Table of a Number while True: print("Enter 'x' for exit.") num = input("Enter a number: ") if num == 'x': break else: number = int(num) for i in range(1, 11): print(number, "*", i, "=", number*i)
Here is the sample run of the above python program to illustrates how to print multiplication table of any number:
You may also like to learn or practice the same program in other popular programming languages: