Number Pattern Generator
Pattern printing is a classic exercise for building real comfort with nested loops — and a genuinely common interview warm-up question.
Example run
Output
--- Pattern 1: Increasing triangle ---
1
12
123
1234
12345
--- Pattern 2: Star pyramid ---
*
**
***
****
*****
--- Pattern 3: Decreasing triangle ---
54321
5432
543
54
5
How to run
Download
starter.py below and run python3 starter.py.
Ideas to make it your own
- Make the size (5 rows) a variable instead of hardcoded.
- Print a pattern using letters (A, AB, ABC, ...) instead of numbers.
- Try building a diamond by combining an increasing and decreasing pyramid back to back.
Why this project matters
Nested loops are exactly how you'd process a grid, a matrix, or any two-dimensional data. The underlying skill — an outer loop controlling rows, an inner loop controlling columns — is used constantly in real software.