# -*- coding: utf-8 -*-
#Created on Sat Sep 21 10:24:49 2019
# @author: MEGHA
m = int(input("How many tables you want to print?"))
n = int(input("How many tables you want to print in each row?"))
p = int(input("How many terms you want in each table?" ))
print ("\nThe MultiPlication Tables are")
print ("****************************** ")
for x in range (1,m,n):
for y in range (1,p+1):
for z in range (1,n+1,1) :
if x+z-1 <= m :
print (str(y) + " * " +str( x+z-1) + " = "+str(y*(x+z-1)), end = "\t ")
print("")
print("")
# end
Result:
How many tables you want to print?15
How many tables you want to print in each row?5
How many terms you want in each table?2
The MultiPlication Tables are
******************************
1 * 1 = 1 1 * 2 = 2 1 * 3 = 3 1 * 4 = 4 1 * 5 = 5
2 * 1 = 2 2 * 2 = 4 2 * 3 = 6 2 * 4 = 8 2 * 5 = 10
1 * 6 = 6 1 * 7 = 7 1 * 8 = 8 1 * 9 = 9 1 * 10 = 10
2 * 6 = 12 2 * 7 = 14 2 * 8 = 16 2 * 9 = 18 2 * 10 = 20
1 * 11 = 11 1 * 12 = 12 1 * 13 = 13 1 * 14 = 14 1 * 15 = 15
2 * 11 = 22 2 * 12 = 24 2 * 13 = 26 2 * 14 = 28 2 * 15 = 30
Comments
Post a Comment