Python program to print the multiplication table of a given number
kw.py
print("________________________________________")
print("Program to print the multiplication table")
print("________________________________________")
try:
    n=int(input("Enter the number "))
    if(n<=0):
        print("Please enter a positive number")
    else:
        for i in range(1,11):
            print(n,"*",i,"=",n*i)
except ValueError:
    print("Enter valid number")
print("________________________________________")
Output
kodingwindow@kw:~$ python3 kw.py
________________________________________
Program to print the multiplication table
________________________________________
Enter the number 81
81 * 1 = 81
81 * 2 = 162
81 * 3 = 243
81 * 4 = 324
81 * 5 = 405
81 * 6 = 486
81 * 7 = 567
81 * 8 = 648
81 * 9 = 729
81 * 10 = 810
________________________________________
Advertisement