Skip to main content

Posts

Showing posts with the label Multiplication Tables

Print Multiplication Tables in Python

# -*- 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      ...