A simple Python program that automatically generates multiplication tables from 2 to 20 and saves each table as a separate text file inside a folder.
This project demonstrates how to use Python loops, functions, and file handling to generate multiplication tables.
For each number from 2 to 20, the program creates a text file containing its multiplication table (1–10). All generated files are stored in a folder named tables.
- Generate multiplication tables from 2 to 20
- Save each table in a separate
.txtfile - Automatically organize files inside a
tablesfolder - Simple and beginner-friendly Python project
- Python 3
- Functions
- For Loops
- File Handling
- String Manipulation
- Functions
- Loops
- File Creation
- Writing to Files
- String Formatting
Multiplication-Tables-Generator/
│
├── main.py
├── tables/
│ ├── table_2.txt
│ ├── table_3.txt
│ ├── ...
│ └── table_20.txt
└── README.md
git clone https://github.com/Muhammad-Ali-Software-Engineer/multiplication-tables-generator.gitcd multiplication-tables-generatorpython main.py5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
This project helps beginners understand:
- Python functions
- Iteration using loops
- File handling
- Creating multiple files automatically
- Working with directories
- String formatting using f-strings
- Allow users to specify the table range
- Generate tables up to any multiplier (e.g., 20 or 100)
- Save tables in PDF format
- Create a GUI version using Tkinter
- Export tables to CSV or Excel
Muhammad Ali
- 🎓 BS Software Engineering Student
- 🐍 Python Enthusiast
- 🇵🇰 Pakistan
⭐ If you found this project helpful, consider giving it a star!