Skip to main content

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         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

Popular posts from this blog

ORACLE Express Edition: Getting Started

1. Introduction to Oracle Database 21c Express Edition (XE) - Free, lightweight version of Oracle Database - Ideal for learning and small-scale applications - Limited to 12GB of user data and uses up to 2GB of RAM 2. Installation and Setup 2.1 Installing Oracle 21c XE 1. Download Oracle 21c XE from: https://www.oracle.com/database/technologies/xe-downloads.html 2. Run the installer:    - Windows: Double-click the .exe file    - Linux: Use `rpm` or `yum` command 3. Follow the installation wizard:  Accept the license agreement Choose an installation location (default is usually fine) Set a password for the SYS, SYSTEM, and PDBADMIN accounts (write this down!) Select the option to start the database service automatically (recommended)  4. Complete the installation: Wait for the installation process to finish Note down the database connection details provided at the end The default container database (CDB) name is XE The default pluggable database (PDB) nam...

Types of DBMS

 DBMS Types Hierarchical DBMS: Structure: Data organized in a tree-like structure with parent-child relationships. Example: IBM's Information Management System (IMS) Use case: Organizational charts, file systems Imagine a family tree: Grandparent Parent 1 Child 1 Child 2 Parent 2 Child 3 Network DBMS: Structure: Data organized in a graph-like structure allowing many-to-many relationships. Example: Integrated Data Store (IDS) Use case: Complex relationship modeling Think of a social network: Person A is friends with Person B and Person C Person B is friends with Person A and Person D Person C is friends with Person A and Person D Relational DBMS: Structure: Data organized in tables with rows and columns, using relationships between tables. Examples: MySQL, Oracle, PostgreSQL Use case: Most common type, used in various applications Imagine a library system: Books table: (ID, Title, Author, ISBN) Members table: (ID, Name, Address, Phone) Loans table...

C|EH (Practical) : Tips and Tricks to write Exam

About the Certified Ethical Hacker (Practical) C|EH Practical is a six-hour, rigorous exam that requires you to demonstrate the application of ethical hacking techniques such as threat vector identification, network scanning, OS detection, vulnerability analysis, system hacking, web app hacking, etc. to solve a security audit challenge. This is the next step after you have attained the highly acclaimed Certified Ethical Hacker certification. Professionals that possess the C|EH credential will be able to sit for exam that will test them to their limits in unearthing vulnerabilities across major operating systems, databases, and networks. You will be given limited time, just like in the real world. The exam was developed by a panel of experienced SMEs and includes 20 real-life scenarios with questions designed to validate essential skills required in the ethical hacking domains as outlined in the C|EH program. It is not a simulated exam but rather, it mimics a real corporate network thro...